在SQL中,使用"JOIN"关键字可以将两个表关联起来。以下是一些常用的JOIN类型:
SELECT * FROM table1
INNER JOIN table2
ON table1.column_name = table2.column_name;
SELECT * FROM table1
LEFT JOIN table2
ON table1.column_name = table2.column_name;
SELECT * FROM table1
RIGHT JOIN table2
ON table1.column_name = table2.column_name;
SELECT * FROM table1
FULL JOIN table2
ON table1.column_name = table2.column_name;
可以根据具体的需求选择适合的JOIN类型来实现表的关联。