The problem of confusion between space in MySQL and Null String query is that in MySQL, if the value of an Element in a string-type domain is null string or space
The problem of confusion between space in MySQL and Null String query is that in MySQL, if the value of an Element in a string-type domain is null string or space
Confusion between space and empty string query in MySQL
In MySQL, if the value of an Element in a string-type field is a null string or space, a problem may occur during query.
Execute Java code
Select * from table where Element = ''or
Java code
The results of select * from table where Element = ''are the same. Empty strings and spaces are not distinguished during query.
If you want to implement exact search, that is, the query is actually a space item, or an empty string item, instead of mixing the two, you must use the Java code
Select * from table where Element like ''or
Java code
Select * from table where Element like''