Knowing the MySQL WHERE Clause Format

Part of the PHP & MySQL For Dummies Cheat Sheet

The WHERE clause is used to modify a DELETE, SELECT, or UPDATE SQL query. This list shows the format you can use when writing a WHERE clause:

WHERE exp AND|OR exp AND|OR exp

where exp can be one of the following:

column = value
column > value
column >= value
column < value
column <= value
column BETWEEN value1 AND value2
column IN (value1,value2,…)
column NOT IN (value1,value2,…)
column LIKE value
column NOT LIKE value
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Advertisement

Inside Dummies.com