Mám prosbu ohledne razeni a vypsaní menu s kategoriemi a podkategoriemi. Jedná se mi o výpis z DB do TreeView formou: -MENU1 -Submenu1 -S-Submenu1 -S-Submenu2 -Submenu2 -MEnu2 V tabulce mam sloupce s daty: ID | Nadpis | ID_Submenu ---------------------------- 10101| Menu1 | NULL 10102| Menu2 | NULL 10103| Submenu1 | 10101 10104| Submenu2 | 10101 10105| S-Submenu1 | 10103 10106| S-Submenu1 | 10103 Zatím jsem docílil pouze výpisu: 10101| Menu1 | NULL | NULL 10103| Menu1 | Submenu1 | NULL 10104| Menu1 | Submenu1 | S-Submenu1 10105| Menu1 | Submenu1 | S-Submenu2 10106| Menu1 | Submenu2 | NULL 10102| Menu2 | NULL | NULL Pomocí tohoto: select root.nadpis as root_nadpis , down1.nadpis as down1_nadpis , down2.nadpis as down2_nadpis , down3.nadpis as down3_nadpis
, root.Poradi , root.PoradiSub
from Menu_Admin as [root] left outer join Menu_Admin as down1 on down1.id_submenu = root.id left outer join Menu_Admin as down2 on down2.id_submenu = down1.id left outer join Menu_Admin as down3 on down3.id_submenu = down2.id where root.id_submenu =0
order by /*root_nadpis , down1_nadpis , down2_nadpis , down3_nadpis , */root.poradi , root.PoradiSub ASC Nedokáže prosím někdo pomoct? Moc všem děkuji...
|