LEFT JOIN ... ON ... 四表联查实例

记一次用的少且时常忘记的多表联查,不清楚在很多数据时这样的效率怎么样?本人菜鸟一枚,路过的高手可指点一下!THX

SELECT 
    a.itemid,a.catid,a.areaid,a.title,a.hits,a.thumb,a.linkurl,a.address,a.sponsor,
    b.itemid,b.content,
    c.catid,c.moduleid,
    d.moduleid,d.name 
FROM 
    exhibit AS a 
    left join exhibit_data AS b ON a.itemid=b.itemid 
    left join category AS c ON a.catid=c.catid 
WHERE 
    a.title LIKE '%北京%' ORDER BY addtime DESC LIMIT 0,10;

你可能感兴趣的:(技术手记)