zero doesnt refer to something, can you fix it? the answer may be like this
SELECT aa.idmenu,
bb.title AS idparent,
aa.title
FROM [yourtablename] aa
LEFT OUTER JOIN [yourtablename] bb
ON aa.idmenu=bb.idmenu
Domanda
I do not know how to select query recursive..
I have table like this:
idmenu idparent Title
1 0 menu_parent1
2 1 menu_child2
3 1 menu_child3
4 0 menu_parent4
5 4 menu_child5
6 4 menu_child6
how do the results like this
idmenu idparent Title
1 menu_parent1 menu_parent1
2 menu_parent1 menu_child2
3 menu_parent1 menu_child3
4 menu_parent4 menu_parent4
5 menu_parent4 menu_child5
6 menu_parent4 menu_child6
anyone help me..thanks
Soluzione
zero doesnt refer to something, can you fix it? the answer may be like this
SELECT aa.idmenu,
bb.title AS idparent,
aa.title
FROM [yourtablename] aa
LEFT OUTER JOIN [yourtablename] bb
ON aa.idmenu=bb.idmenu