koolis55
koolis55

Reputation: 11

mysql where clause field

I am trying to understand a piece of mysql code:

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.

Thanks in advance

Upvotes: 1

Views: 50

Answers (2)

Richard Parnaby-King
Richard Parnaby-King

Reputation: 14892

An empty where condition, as above, is effectively the same as AND LENGTH(statement) > 0. So any non-empty value in the statement column will be returned.

Upvotes: 0

&#193;lvaro Gonz&#225;lez
&#193;lvaro Gonz&#225;lez

Reputation: 146578

This is a MySQL peculiarity that other database engines do not exhibit. In other DBMS the equivalent would be:

and statement<>0

Upvotes: 3

Related Questions