MySQL左聯多表查詢where前提寫法示例。本站提示廣大學習愛好者:(MySQL左聯多表查詢where前提寫法示例)文章只能為提供參考,不一定能成為您想要的結果。以下是MySQL左聯多表查詢where前提寫法示例正文
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;
這兩條語句成果是分歧的,應當是left join的時刻假如前提是多個表mysql會主動轉成內聯招致,第二條語句能力到達准確的目標(為了找到相差的兩條數據)。