1SELECT user_id, user_name
2FROM users
3UNION
4SELECT organization_id, organization_name
5FROM organizations
1create table yourTableName
2(
3 select *from yourTableName1
4)
5UNION
6(
7 select *from yourTableName2
8);
1Joins are used with select statement. it is used to select data from multiple table.
2Types:
3MySQL INNER JOIN (or simple join)
4MySQL LEFT OUTER JOIN (or LEFT JOIN)
5MySQL RIGHT OUTER JOIN (or RIGHT JOIN)
6
7Inner JOIN :
8The INNER JOIN is used to return all rows from multiple tables where the join condition is satisfied. It is the most common type of join.
9
10Left Outer Join:
11The LEFT OUTER JOIN returns all rows from the left hand table specified in the ON condition and only those rows from the other table where the join condition is fulfilled.
12
13Right Outer Join:
14The Right Outer Join returns all rows from the RIGHT-hand table specified in the ON condition and only those rows from the other table where he join condition is fulfilled.