Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> need help with sql
I have the following simple query that pulls information for a gui tree menu
SELECT item_id, item_title, item_order, parent_id, shared_id
FROM tree_menu
ORDER BY item_order;
I need to select the item_title in the normal way, except when shared_id is not zero. If its not zero it means shared_id holds the item_id of another item. If it's not zero then I need to get the item_title with id of shared_id.
basically something like:
SELECT item_id, (IF shared_id = 0 THEN item_title ELSE item_title of item
with item_id = shared_id), item_order, parent_id, shared_id
FROM tree_menu
ORDER BY item_order;
Oracle 9i
Thanks in Advance Received on Wed Mar 02 2005 - 15:09:44 CST
![]() |
![]() |