An infinite classification table. The primary table field FID and parent class ID field FPID are simple columns. Retrieve the dataset's SQL statement with a as (select FID from table where FID = 'value' union allselect x. FID from Table x, a where x. FPID =. FID) select * from a: the SQL statement www.2cto.com with a as (select FID from table where FID = 'value' union allselect x. FID from Table x, a where x. FPID =. FID) delete from table where FID in (select FID from)
1. x can be understood as a slave table name in a alias or join statement. if you rewrite the search statement with a as (select * from table where FID = 'value' union allselect. * from ArticleType x, a where x. FPID =. FID) select * from a may show that the "statement is terminated. The maximum recursion 100 error is returned before the statement is executed. The solution is as follows:
When the union clause retrieves data sets, the number/type of their fields must be the same/Corresponding. This is my understanding with a as (select Field 1, Field 2, Field 3, field 4 .. from table where FID = 'value' union allselect x. field 1, x. field 2, x. field 3, x. field 4 .. from table x, a where x. FPID =. FID) select * from a www.2cto.com PS, but someone else can give you two points... ". I know that everyone's experience and technical skills are different. Although cainiao like me have less than a year of graduation work, there are still many shortcomings and areas to learn, but they are not very lucky, if you encounter problems in your work practice at ordinary times, you have the opportunity and time to write your thoughts and accumulate a little bit. Author wisonlee