select * from tableA inner join tableB on tableA.id=tableB.id select * from tableA inner join tableB on using(id)
MYSQL的语法: The USING(column_list) clause names a list of columns that must exist in both tables. If tables a and b both contain columns c1, c2, and c3, the following join compares corresponding columns from the two tables: a LEFT JOIN b USING (c1,c2,c3)SELECT * FROM t1 INNER JOIN t2 USING (j); SELECT * FROM t1 INNER JOIN t2 ON T1.J=T2.J;
from A left join B on A.id=B.id
select * from tableA inner join tableB on using(id)
The USING(column_list) clause names a list of columns that must exist in both tables. If tables a and b both contain columns c1, c2, and c3, the following join compares corresponding columns from the two tables: a LEFT JOIN b USING (c1,c2,c3)SELECT * FROM t1 INNER JOIN t2 USING (j);
SELECT * FROM t1 INNER JOIN t2 ON T1.J=T2.J;