亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

MySQL左聯(lián)多表查詢where條件寫法示例

 更新時間:2015年02月13日 09:05:39   投稿:junjie  
這篇文章主要介紹了MySQL左聯(lián)多表查詢where條件寫法示例,本文直接給出寫法示例,需要的朋友可以參考下

復(fù)制代碼 代碼如下:

select * from _test a left join _test b on a.id=b.id where a.level='20' and a.month='04' and b.level='20' and b.month='03';

select a.*,b.* from (select * from _test where level='20' and month='04') as a left join (select * from _test where level='20' and month='03') as b on a.id=b.id;

這兩條語句結(jié)果是不同的,應(yīng)該是left join的時候如果條件是多個表mysql會自動轉(zhuǎn)成內(nèi)聯(lián)導(dǎo)致,第二條語句才能達到正確的目的(為了找到相差的兩條數(shù)據(jù))。

相關(guān)文章

最新評論