How to join several unrelated tables
问题 I have five queries and each of them will return me single column multiple row output. I want to to write a function which will contain all of these queries. Can anyone help? query 1: Select Col1 as X from Table1; query 2: Select Col3 as Y from Table2; From a function I want to get a table which will have columns X, Y How to club these queries under single function? 回答1: Add a ROW_NUMBER() to each of the queries and join them by the row number. Depending on number of rows returned by each of