DEFINE fromtable1= true;WITH firstQuery AS ( SELECT columns FROM table),secondQuery AS ( SELECT columns FROM second_table) IF @fromtable1= true BEGIN SELECT * FROM firstQuery ENDELSE BEGIN SELECT * FROM secondQuery END
In oracle I tried above but I get error is there a way to make a query like this