Reputation: 11
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
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
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