question_type!= 'A'以外のすべてを選択しようとしています。 question_typeがNULLの場合、行はデータを返しません。mysql - NULLの値のときに行を返しません。
select * from table where question_type!= 'A';
question_type!= 'A'以外のすべてを選択しようとしています。 question_typeがNULLの場合、行はデータを返しません。mysql - NULLの値のときに行を返しません。
select * from table where question_type!= 'A';
したがって、これをwhere
句に含めます。
select t.*
from table t
where question_type <> 'A' or question_type is null;
あるいは、 "ヌル・安全" に等しいを使用:
select t.*
from table t
where not question_type <=> 'A' ;
ANSI SQLはIS DISTINCT FROM
とIS NOT DISTINCT FROM
を実装しています。 <=>
演算子はIS NOT DISTINCT FROM
に相当します。
です! –
null
の場合の戻り値と先に行く:
select * from table where COALESCE(question_type, '') <> 'A';
どこ 'OR、QUESTION_TYPE247に追加がnullセーフ等しい岩NULL' –