This query is making me crazy... [modified]
-
Hi, I have to show a filesystem on a page. The information is stored in a table where I have ID(PK), Name, Parent, Order 001, Node1, NULL, 1 002, Node2, NULL, 2 003, Node3, 001, 1 004, Node4, 001, 2 005, Node5, 002, 2 I need to display the results as it should be seen: +Node1 Node3 Node4 +Node2 Node5 The query I have is like this: SELECT A.* FROM TableFS A LEFT OUTER JOIN TableFS B ON A.ParentID = B.ItemID ORDER BY A.ParentID, B.Order The result is similar to what I should get, but similar is not enough... at least it's what they tell me... ;P If anyone can help... :rolleyes: Thanks...!
-
Hi, I have to show a filesystem on a page. The information is stored in a table where I have ID(PK), Name, Parent, Order 001, Node1, NULL, 1 002, Node2, NULL, 2 003, Node3, 001, 1 004, Node4, 001, 2 005, Node5, 002, 2 I need to display the results as it should be seen: +Node1 Node3 Node4 +Node2 Node5 The query I have is like this: SELECT A.* FROM TableFS A LEFT OUTER JOIN TableFS B ON A.ParentID = B.ItemID ORDER BY A.ParentID, B.Order The result is similar to what I should get, but similar is not enough... at least it's what they tell me... ;P If anyone can help... :rolleyes: Thanks...!
-
SELECT A.* FROM TableFS A INNER JOIN TableFS B ON A.ItemID = B.ParentID ORDER BY A.ParentID, B.Order
Regards KP