I have the following tables :
specifications :
id | name
-----------
1 | hello
2 | world
3 | foo
4 | bar
properties :
name | value | specID
---------------------
status | finish | 1
parent | 2 | 1
status | work | 2
parent | 3 | 2
status | ... | 4
parent | 3 | 4
Now I want to say :
List all specifications under specID 3.
I don't now the levels down but the result must be:
id | name | parent
------------------
3 | foo | NULL
2 | world | 3
1 | hello | 2
4 | bar | 3
How can i do this in mysql?