Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Beginner SQL question (select statement)
Atif Ahmad Khan wrote:
>
> I have 2 tables. 1. Product 2. Warehouses. Products has the rows :
> part_number, warehouse_id1, warehouse_id2, qty_available_1, qty_available_2
> values (123456, 100 , 200 , 500, 400)
> Warehouses has : warehouseid, warehouse_location.
> values (100 , Houston
> 200 , Phoenix)
select warehouse_location, qty_available1 from product, warehouses
where part_number = '123456' and warehouseid = warehouse_id1
union
( select warehouse_location, qty_available2 from product, warehouses
where part_number = '123456' and warehouseid = warehouse_id2 )
--- Name : Lun Wing San Title : Oracle Application Developer of Hong Kong Productivity Council Oracle Database Administrator and System Administrator of QRC Phone : (852)27885841Received on Fri Dec 20 1996 - 00:00:00 CST