JDCam
asked on
Oracle 10g - Select based on outcome of first select
Experts,
An easy one today...
I have two working select statements. I need to combine them so that if my input variable matches the first select, I return the results of the second select. If the Variable does not match, nothing should be returned.
Please help me with the syntax
An easy one today...
I have two working select statements. I need to combine them so that if my input variable matches the first select, I return the results of the second select. If the Variable does not match, nothing should be returned.
Please help me with the syntax
IF vQTY = (
Select
ITEM_QTY_BKD_QTY
from M_Item_D1 where comp_Code = 'T2'
and Cust_Code = 'BARITEST'
and Item_Code = '003562'
and ITEM_QTY_BKD_LEV_NUM = 1)
select
ITEM_QTY_BKD_NUM_LAY LAYERS,
ITEM_QTY_BKD_QTY_PER_LAY QTY
from M_Item_D1 where comp_code = 'T2'
and cust_code = 'BARITEST'
and item_code = '003562'
and item_qty_bkd_lev_num = 1
why not simply join these tables?!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No need to join tables, it is the same table.
ASKER
Wow... I was trying way too hard and looked right past the obvious.
thanks
thanks
No need to join tables, it is the same table.
I didn't mean it that way ;-)
I was aware of that fact