Mysql左连接

分类:技术文档 - PHP文档 | 阅读(2314) | 发布于:2014-11-18 17:46

Mysql左连接3帐表
SELECT c.user_name, c.report_name, c.url, g.name, a.alias FROM collected_report c
LEFT JOIN reportGroupsSet gs ON gs.author =c.user_name AND gs.reportID = c.url
LEFT JOIN reportGroups g ON g.author =c.user_name AND g.id = gs.groupID
LEFT JOIN reportAliasSet a ON a.reportID = c.url 
WHERE c.user_name = 'lixiaocheng' 

标签:Mysql左连接LEFT_JOIN