Hello,
I want to join 3 tables and display the results in a Region. Example query shown below. The columns from TableC below can change based on requirement (E.g. Below sql below has TableC - Column1, Column2, Column3, Column4, Column5. It could change to TableC - Column16, Column17, Column18, Column19, Column20, next run time to different set of columns). I want the results each time to display appropriate column headings based on the columns chosen in the dynamic SQL.
SELECT TableA.Column1,
TableA.Column2,
TableB.Column1,
TableB.Column2,
TableB.Column3,
TableB.Column4,
TableC.Column1,
TableC.Column2,
TableC.Column3,
TableC.Column4,
TableC.Column5
FROM TableA,
TableB,
TableC
WHERE TableA.DateColumn = '10-FEB-17'
AND TableA.Column1 = TableB.Column1
AND TableB.Column1 = TableC.Column1
ORDER BY TableA.Column1;
Any help is much appreciated.