Smart nested quiry

wxdqz

New Member
Hi all.
I have a table that has an ID primary key
and parentID wich point to the parent
of the current ID.

like:
ID NAME PARENTID
-- - ---- --------
1 John -
2 Fofo 1
3 Fofo2 1
4 Fofo3 2
5 Fofo5 2
6 Fofo6 3

and so on ...

now i want to select all ID's that under ID
no 2 for example.
it means that for ID no 2 i'll get
4,5,6 and NOT only 4,5
Thanks ,
Maoz.
 
Back
Top