I have two tables with no relation between them. The following is a query I've tried:
SELECT table1.columnName, table2.columnName AS newColumn
FROM table1, table2.
I am unable to get the results I need.
I have two tables with no relation between them. The following is a query I've tried:
SELECT table1.columnName, table2.columnName AS newColumn
FROM table1, table2.
I am unable to get the results I need.
Assuming you want the columns combined into a single column, without a where clause, that's going to give you a (probably larger than you want) Cartesian product, but you can do it with something like:
select concat (tbl1.col1, tbl2.col2) from tbl1, tbl2
If you want a single column with values from both tables (rather than concatenating them), just use something like:
select col1 as col from tbl1
union
select col2 as col from tbl2