SQL Tables
-
I need some advice. I have 2 tables. They are not related in any way except that they are in the same DB. Now I need to write a select query where it returns the columns from table1 and columns from table2. How can I achieve this? My Query at the moment is: SELECT Table1.Column1, Table1.Column2, Table2.Column1 AS EXPR1 FROM Table1 CROSS JOIN Table1 AS Table2 Thank you in advance!!
Illegal Operation Making Computer Software Talk
-
I need some advice. I have 2 tables. They are not related in any way except that they are in the same DB. Now I need to write a select query where it returns the columns from table1 and columns from table2. How can I achieve this? My Query at the moment is: SELECT Table1.Column1, Table1.Column2, Table2.Column1 AS EXPR1 FROM Table1 CROSS JOIN Table1 AS Table2 Thank you in advance!!
Illegal Operation Making Computer Software Talk
Since the tables are not related in any way it probably makes sense to return multiple result sets. If you are calling a stored procedure, which I highly suggest, you could just do this: Select column1, column2 from table1 select column1 as expr1 from table2 Then you would get two results sets to work with. Hope that helps. Ben