select * from websites;
INSERT INTO `access_log` (`aid`, `site_id`, `count`, `date`) VALUES (‘10‘, ‘6‘, ‘111‘, ‘2016-03-09‘);
1 SELECT 2 w.`name`, 3 al.count, 4 al.date 5 FROM 6 websites AS w 7 RIGHT JOIN access_log AS al ON al.site_id = w.id 8 ORDER BY 9 al.count DESC;
By:RIGHT JOIN 关键字从右表(table2)返回所有的行,即使左表(table1)中没有匹配。如果左表中没有匹配,则结果为 NULL。
原文链接来自:https://www.runoob.com/sql/sql-join-right.html
故屿γ