inner join和left join
查询所有商品(product),包含他的所有的评论(comment),包含评论下的user
要使用
SELECT * FROM product p
LEFT JOIN COMMENT c ON p.pid=c.product_id
LEFT JOIN USER u ON c.other_user_id=u.id
而
SELECT * FROM product p
INNER JOIN COMMENT c ON p.pid=c.product_id
INNER JOIN USER u WHERE c.other_user_id=u.id
只能实现根据右边有的查询