'Can I join two tables in MYSQL and create a new table
I want to make a new table after joining this two tables if it is possible
SELECT * FROM tablepeople
JOIN tableinfo
ON tablepeople.id = tableinfo.ctrlid
Solution 1:[1]
you can use
Create table new_table
Create table new_table as
SELECT * FROM customers
LEFT JOIN orders ON customers.idcustomers = orders.idorders
UNION
SELECT * FROM customers
RIGHT JOIN orders ON customers.idcustomers = orders.idorders;
Solution 2:[2]
CREATE TEMPORARY TABLE [table_name] ( [query] );
OR
CREATE TABLE [table_name] ( [query] );
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | kkrkuldeep |
| Solution 2 | gamer |
