Is there a special character in mySql that would return always true in WHERE clauses?

Posted by rm. on Stack Overflow See other posts from Stack Overflow or by rm.
Published on 2012-03-19T09:15:22Z Indexed on 2012/03/19 10:03 UTC
Read the original article Hit count: 356

Filed under:
|

Is there a character, say, $,

SELECT * FROM Persons WHERE firstName='Peter' AND areaCode=$;

such that the statement would return the same as

SELECT * FROM Persons WHERE firstName='Peter'

i.e. areaCode=$ would always return always true and, thus, effectively “turns of” the criteria areaCode=...

I’m writing a VBA code in Excel that fetches some rows based on a number of criteria. The criteria can either be enabled or disabled. A character like $ would make the disabling so much easier.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql