[eluser]Bluemagix[/eluser]
Hello,
I have table called category
having fields, records like this
id name parentid
1 Bank 0
2 Shopping 0
3 Axis 1
4 ICICI 1
5 SBI 1
6 Nike 2
7 xyz 2
where parentid 0 means major categories.
and for other is shows the sub category according to parentid
Eg: icici's parentid is 1 because it comes under bank [having id]
Now, i want result as
Bank
Axis
ICICI
SBI
Shopping
Nike
xyz
How can i do that??
which query i should use??