Home > database > Mysql recursive query result in two different query results, the same method with no parameters
Mysql recursive query result in two different query results, the same method with no parameters
Time:09-17
This is my SQL SELECT ID. LEVEL1, DATA1. * The FROM ( SELECT @ ids AS _ids, (SELECT @ ids:=GROUP_CONCAT (gid) FROM project_grouping WHERE FIND_IN_SET (parent_id, @ ids)) AS cids, @ : l=@ l + 1 AS LEVEL1 The FROM Project_grouping, (SELECT @ ids:=# {parent_id}, @ : l=1) b WHERE @ ids IS NOT NULL ) ID, Project_grouping DATA1 WHERE FIND_IN_SET (DATA1. Gid, ID. _ids) AND gid=# {gid}
The ORDER BY LEVEL1, Gid
query structure this problem bothering me too much, with two days, can add cent, who deliver me
CodePudding user response:
The first query or article 15 second is only five
CodePudding user response:
It takes some time to understand demand ah, good complex
CodePudding user response:
The performance must be very poor, but also may be a deadlock, overlock wait