One query has IDs needed to run the second query. Is there a way to join those two?
select id from test_table1; select * from table(f_function(null ,null ,1 -- the id ,sysdate);
Igor S. wrote:Listing comma-separated tables is Oracle join syntax. But TABLE operator makes it a join of a different flavor. Oracle will take one row from test_table1, execute function f_function, table it using table operator and join that test_table1 row to results. Then it will take next row from test_table1 and do the same.
Igor S. wrote:Try it and see.
select * from test_table1, table( f_function( null, null, id, sysdate ) ) /So these two queries are the same?
select * from test_table1, table( f_function( null, null, id, sysdate ) xyz ) where test_table1.id = xyz.id /
Then, assuming f_function produces a column called id, it will work.
select * from test_table1, table( f_function( null, null, id, sysdate ) -- No alias here ) xyz -- Alias here, instead where test_table1.id = xyz.id /
Igor S. wrote:As Frnak already mentioned, alias is in wrong place. Other than that, I can't tell since you didn't post function result type structure. If id is one of attributes in function return type, then it will work. Otherwise it will fail.
So these two queries are the same?