MySQL INNER JOIN,LEFT JOIN,RIGHT JOIN连接的使用

MySQL INNER JOIN,LEFT JOIN,RIGHT JOIN连接的使用

INNER JOIN
mysql> SELECT a.runoob_id, a.runoob_author, b.runoob_count FROM runoob_tbl a INNER JOIN tcount_tbl b ON a.runoob_author = b.runoob_author;

LEFT JOIN
mysql> SELECT a.runoob_id, a.runoob_author, b.runoob_count FROM runoob_tbl a LEFT JOIN tcount_tbl b ON a.runoob_author = b.runoob_author;

RIGHT JOIN
mysql> SELECT a.runoob_id, a.runoob_author, b.runoob_count FROM runoob_tbl a RIGHT JOIN tcount_tbl b ON a.runoob_author = b.runoob_author;


文章来自 www.dgkunfu.com

posted @ 2022-05-13 11:30  学无边涯  阅读(37)  评论(0编辑  收藏  举报