I am having a query problem
Here is my db structure
PK_ID,title,parent
1,Propery,0
2,Services,0
3,Rent,1
4,House,3
Now I have PK_ID=4 and want to find its name which is House, its parent name which is Rent and then its parent which is Property
I don't know how to make query for it?
any idea
thank you
-dizyn
small query problem
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Re: small query problem
Read http://www.sitepoint.com/article/hierar ... a-database
There's no way to do this, with your current structure, without subqueries or multiple queries.
There's no way to do this, with your current structure, without subqueries or multiple queries.