JOIN
Combines rows from two or more tables based on a related column.
Syntax
sql
SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.t1_id;Example
sql
SELECT p.title, u.name
FROM posts p
INNER JOIN users u ON p.author_id = u.id;Combines rows from two or more tables based on a related column.
SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.t1_id;SELECT p.title, u.name
FROM posts p
INNER JOIN users u ON p.author_id = u.id;