SQL statement where 1=1

Improve some kind of execution efficiency?

1=1 =1; 1=1; 1=1;

This 1=1 is often used by applications to piece together where conditions based on different user choices.

For example, when you query user information on the Web UI, the default VALUE of WHERE is 1=1. In this way, the SQL query does not fail even if you do not select any condition. If the user selects a name, then where becomes where 1=1 and name =’ name entered by the user ‘. If other conditions are selected, just append and to the where condition.

If 1=1, add a condition where (1=1). If there is, write and statement, so using 1=1 can simplify the application complexity.

Source: www.cnblogs.com/kunpengv5/p…