Hi For a lot of days i'm pouding this sql, however cant decipher it,some of you've suggestion .

Essentially it's a category table with domain names like : id, title(title of category), parent(2nd floor of category). For instance of datas

1  Fruit        0
2  Apple        1
3  pear         1
4  FujiApple    2
5  AusApple     2
6  SydneyAPPLE  5
....

you will find many levels, maybe a lot more than 3 levels, now i wish to create an sql that grouping the datas based on parent>children>grand child .....

something similar to a tree

1 Fruit 0
--2 Apple 1
----4 FujiApple 2
----5 AusApple 2
------6 SydneyApple 5
--3 pear 1

can one do that utilizing a single SQL query? or i have to do

SELECT * FROM category WHERE parent=0

Following this, i loop with the datas then choose again where parent=id??