在MySQL中連接兩個表的方法有以下幾種:
SELECT * FROM table1 INNER JOIN table2 ON table1.id = table2.id;
SELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.id;
SELECT * FROM table1 RIGHT JOIN table2 ON table1.id = table2.id;
SELECT * FROM table1 FULL JOIN table2 ON table1.id = table2.id;
SELECT * FROM table1 CROSS JOIN table2;
以上是常見的連接兩個表的方法,根據實際需求選擇合適的連接方式。