【发布时间】:2011-01-12 13:58:21
【问题描述】:
如何在Mysql中使用条件where子句?
Select * from table where SubId='1' and null
对吗?我想显示 subId=1 的记录和 subId 为 null 的行
任何建议...
【问题讨论】:
-
阅读条件。因为例如: Select * from table where SubId='2' or '1' 并不意味着它会检查 SubId 是否等于 '2' 或 '1'。它将检查 SubId 是否等于“2”或“1”是否为真
标签: mysql conditional where-clause