shiv shiv - 4 months ago 21
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
""=""
mean?

Answer

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 :

SELECT * 
  FROM users