What happens when I run the query "SELECT * FROM table_name WHERE column_name;"?

I have a database table with multiple columns. One of the columns is intended to be used as a logical setting like TINYINT (1) DEFAULT 0.

I accidentally discovered that if you run this query

SELECT * FROM table_name WHERE column_name;

it returns rows with the name column_name = 1.

I am curious to know the logic that MySql uses to process this request.

+4
source share
1 answer

As the documentation says in the "Syntax Selection" section, ( http://dev.mysql.com/doc/refman/5.1/en/select.html )

where_condition is an expression that evaluates to true for each selected row

, . , ints.

+2

All Articles