Skip to Content
0
Nov 21, 2011 at 05:36 PM

Different Ways of Code

22 Views

Can I build a query in a different way without using alias tables of position,physical Quantity in the WEBI report level.

 (SELECT   DISTINCT pp2.trade subtrade, 
                                         pq2.shipment subshipment, 
                                         pp2.POSITION subposition, 
                                         pq2.measure 
                                    FROM counterparty cp, 
                                         position pp, 
                                         physicalquantity pq, 
                                         physicalquantity pq2, 
                                         position pp2 
                                   WHERE pp.POSITION = pq.POSITION 
                                     AND pq.quantitystatus = 'ACTUAL' 
                                     AND pq.shipment = pq2.shipment 
                                     AND pp2.POSITION = pq2.POSITION 
                                     AND pq2.quantitystatus = 'ACTUAL' 
                                     AND (pp.position <> pp2.position OR pp2.position IS NULL) 
                                     AND pp.counterparty = cp.counterparty(+))