shamika Dharmasiri
shamika Dharmasiri

Reputation: 377

Combine columns from multiple select queries to make single table

I have two SELECT queries.

TABLE1

enter image description here

TABLE2

enter image description here

SELECT * FROM TABLE1;
SELECT * FROM TABLE2;

Both TABLE1,TABLE2 have one row and same amount of columns.They don's have any common columns. I want to crate following table.

enter image description here

Upvotes: 1

Views: 250

Answers (2)

Shoaeb
Shoaeb

Reputation: 919

Maybe you are looking for this...

SELECT * FROM TABLE1 tab1,TABLE2 tab2;

Upvotes: 1

Swan Toma
Swan Toma

Reputation: 146

Try the union operator:

SELECT * FROM TABLE1
UNION
SELECT * FROM TABLE2

Also, be aware of the difference between UNION vs UNION ALL: MySQL UNION

Upvotes: 0

Related Questions