【问题标题】:mysql where clause fieldmysql where子句字段
【发布时间】:2018-01-09 15:57:03
【问题描述】:

我正在尝试理解一段mysql代码:

Select * from tableA   
where type = 'blue'  
and status = 'confirmed' 
and statement   
and date between '2017-01-01' and '2017-12-31'

“and 语句”是否意味着 where 语句是一个字段但没有 =、or、and、>、

提前致谢

【问题讨论】:

  • 语句列的数据类型是什么?

标签: mysql field where


【解决方案1】:

这是其他数据库引擎不具备的 MySQL 特性。在其他 DBMS 中相当于:

and statement<>0

【讨论】:

    【解决方案2】:

    如上的空 where 条件实际上与 AND LENGTH(statement) &gt; 0 相同。因此,statement 列中的任何非空值都会被返回。

    【讨论】:

    • 非空或非零。
    猜你喜欢
    • 1970-01-01
    • 2017-12-28
    • 1970-01-01
    • 2021-10-13
    • 2019-10-04
    • 1970-01-01
    • 1970-01-01
    • 2021-01-20
    • 1970-01-01
    相关资源
    最近更新 更多