Hi Folks,
This is my use case
1) Select fact records from tables (say A,B,C,D ) with suitable Joins and certain Where conditions
SELECT ordid FROM TABLES A,B,C,D on join condition where ....
2) Using above header records , I have to select each and every item level data from different tables ( say X,Y,Z ) and perform calculation to derive new columns to update a new table ( Zreport )
UPDATE TABLE ZREPORT
SET col1 = ( Select qty FROM TABLE X WHERE ordid = A.ordid
UPDATE TABLE ZREPORT
SET col2 = ( Select price FROM TABLE y WHERE ordid = B.ordid.
and so on for other columns..
3) Zreport table will be used for reporting.
I would like to know the best way to achieve this to gain performance.
Appreciate the help!
Thanks
Sourav