MySql tinyint令人困惑的工作

时间:2017-07-05 16:14:29

标签: mysql sql

我有一个select,with inactive column,是tinyint

SELECT
test_case.caseid AS caseid,
test_case.inactive AS inactive
from test_case
WHERE test_case.inactive = "{inactive_value}"

如果inactive_value" 0"或" 1"按预期工作,但如果我写" str",那么结果将赢得&#t; t是空的。结果将是全部,或至少是无效=" 0"

为什么这个SQl选择会发生?

DDL相关部分:

inactive tinyint default '0' not null

0 个答案:

没有答案