简体   繁体   English

mysql where子句字段

[英]mysql where clause field

I am trying to understand a piece of mysql code: 我试图了解一段mysql代码:

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

Would would the "and statement" mean where statement is a field but without an =, or, and, >, < ect. “和声明”会意味着where语句是一个字段但没有=,或,和,>,等等。

Thanks in advance 提前致谢

This is a MySQL peculiarity that other database engines do not exhibit. 这是其他数据库引擎没有展示的MySQL特性。 In other DBMS the equivalent would be: 在其他DBMS中,等效的是:

and statement<>0

An empty where condition, as above, is effectively the same as AND LENGTH(statement) > 0 . 如上所述,空的where条件实际上与AND LENGTH(statement) > 0 So any non-empty value in the statement column will be returned. 因此将返回statement列中的任何非空值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM