shiv shiv - 1 year ago 105
SQL Question

What does ""="" mean in a SQL SELECT statement?

I have a SQL SELECT Statement which is,

SELECT * FROM users WHERE ""=""

The result is it returns all the rows.

So, what does

Answer Source

This is an unnecessary WHERE clause indicating that all rows should be selected.

The = operator is used to check equality, and a WHERE clause will return all records where a specific condition is true (in this case ""=""). Since this condition will always evaluate as true (as an empty string is always equal to an empty string), all of the rows within the table will be selected.

You could leave it off entirely to receive the same results :

  FROM users
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download