Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> need help with sql

need help with sql

From: Starton X. Mangrove <desdfsdf_sdf393_at_yahoo.com>
Date: Wed, 02 Mar 2005 21:09:44 GMT
Message-ID: <sYpVd.19075$534.6379@twister.nyc.rr.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US