First of all, sorry for the bad title. I am in little hurry and couldn't think of a better one.
Now I have a table like this -
category_id name parent_category_id
______________________________________
1 country 0
2 state 1
3 city 2
4 block 3
And I want results as -
Name ParentCategory
___________________________
country NULL
state country
city state
block city
Now the logic is ParentCategory is category name whose category_id is equal to parent_category_id. (Not sure if I explained it properly) I tried a lot writing a query for this, but don't know how can I do it.
Any help would be most appreciated.