select - Joining the Column Outputs of Two or More Columns from a MySQL Query -


i trying join outputs of 2 or more mysql queries. if query 1 has n columns , query 2 has m columns, output should have n+m columns. example:

select * (select 1,2,3) x,               (select 4,5) y; 

the output here :

1 2 3 4 5 

now issue second query may produce no results. case results in no output @ all:

 select * (select * table_0) x,               (select * table_1) y; 

if table_1 returns no matches, combined output returns no rows. still entries of first table returned.

while have workaround, involves individual queries each of m columns. not want create temporary tables , join them.

a left join should it:

select * (select * table_0) x     left join (select * table_1) y on 1; 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -