I have 2 tables A
and B
which I want to join using a column id
and create a third table C
from that.
I performed this query:
create table C select * from ( A left join B using (id))T;
But it is giving error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'T' at line 1
I don't know why the error is coming.
remove the following
FROM
before SELECT
ALIAS
also
Tip, When creating a table with CREATE TABLE ... SELECT
, make sure to alias any function calls or expressions in the query. If you do not, the CREATE statement might fail or result in undesirable column names.
query,
CREATE TABLE C
SELECT *
FROM A
LEFT JOIN B USING (id)