Question : Oracle Query Help

Hi

The following query returns 2 rows. But I need output in single row. Can you pls help

SELECT  stocktransfer.stocktransfer_id,STORE.description "storefrom", stocktransfer.quantity, stocktransfer.createddate,from_storecode,to_storecode,

       stocktransfer.productcode
  FROM stocktransfer
    join store on stocktransfer.from_storecode =STORE.STORECODE where to_storecode is not null
   
   union all
 
 SELECT  stocktransfer.stocktransfer_id,STORE.description "storeto", stocktransfer.quantity, stocktransfer.createddate,from_storecode,to_storecode,

       stocktransfer.productcode
  FROM stocktransfer
     join store on
  stocktransfer.to_storecode=STORE.STORECODE where from_storecode is not null

Answer : Oracle Query Help

try :

select x.*,y.*
 from
(SELECT  stocktransfer.stocktransfer_id,STORE.description "storefrom", stocktransfer.quantity, stocktransfer.createddate,from_storecode,to_storecode,

       stocktransfer.productcode
  FROM stocktransfer
    join store on stocktransfer.from_storecode =STORE.STORECODE where to_storecode is not null ) x,
(  
 SELECT  stocktransfer.stocktransfer_id,STORE.description "storeto", stocktransfer.quantity, stocktransfer.createddate,from_storecode,to_storecode,
       stocktransfer.productcode
  FROM stocktransfer
     join store on
  stocktransfer.to_storecode=STORE.STORECODE where from_storecode is not null  ) y

Thanks,
Random Solutions  
 
programming4us programming4us