SELECT tb.ID, tb.NAME, square
FROM MY_TABLE tb
CROSS JOIN
(SELECT POWER(tb.ID,2) as square FROM DUAL)
I want to figure out whether it is possible to do something like this, cross join particular result set to subquery while putting in value from result set to subquery.
Power function here is just for the example. Instead of it I have massive subquery that should be completed with various parameters.
This particular example fails with ORA-00904
Basically I need to add to each row of the given result set the result of subquery, but I need to complete this subquery using data from this row, so each time subquery would be completed with various data.
This is wrong:
because that subquery doesn't "see"
my_table(whose alias istb).Code that works might be e.g.
but ... you didn't say what you actually expect as result.