Ok so I have a table called categories that looks like this:
id name parent_id
1 camera null
2 computer null
3 digital 1
4 gps null
5 laptop 2
I want to be able to return computer -> laptop or camera -> digital when I query id = 3 or 5.
Any ideas?