1
這個問題可能非常簡單,但我不明白空值是如何在mysql語法中表現的。假設我有這個準備要求:mysql查詢:null值加入時的行爲
select t1.*
from table1 t1
left join table2 t2
on t1.id = t2.id
and some_entry = :value
where t2.the_id is null
some_entry是表2項,t2.the_id是表2的增量索引。如果table2爲空,輸出是什麼?
即使some_entry是table2列嗎? – user1611830
是的。試試這個'和some_entry =:值 其中t2.the_id不爲空'來查看差異。 –
順便說一句,這個請求的原因是什麼,因爲如果table2不是空的,t2.the_id不會是空的? – user1611830