三表關聯查詢-多次LEFT JOIN...ON

夢康發表於2013-05-27
$sql = "SELECT a.year,a.guid,a.description,b.description AS pic_des,c.year AS pic_year,c.month AS pic_month,c.day AS pic_day,c.file AS pic_file 
FROM m_honor2_honor2 a LEFT JOIN m_honor2_pics b ON a.guid = b.honor2_guid 
LEFT JOIN sys_file c ON b.image= c.guid
WHERE a.year = $year
ORDER BY a.order_is DESC";

相關文章