我在MySQL數據庫的兩個表,這些表是:MySQL的選擇左邊的所有行,並讓空右表
上一個表是jenis_pohon
和下一個是jtt
如何在jenis_pohon
選擇所有的行,並與jtt
與條件加入它jtt.tahun='2016' AND jtt.koperasi_id='4'
我嘗試以下查詢:
SELECT * FROM `jenis_pohon` LEFT JOIN jtt ON jenis_pohon.jenis_pohon_id=jtt.jenis_pohon_id WHERE jtt.tahun='2016' AND jtt.koperasi_id='4'
但沒有運氣。
basicaly我想返回6行(這6行來自jenis_pohon
)。
什麼是您預期的輸出? – Faisal
[this](http://stackoverflow.com/questions/9160991/left-join-with-condition)有幫助嗎? –
@TerryLi awesomeee ......我正在尋找什麼。非常感謝。 –