I want to write an SQL query that will retrieve all students who live in a particular Postal Code. Below is my request.
SELECT * FROM `students` AS ss WHERE ss.`postcode` LIKE 'SE4 1NA';
Now the problem is that in the database some records are stored without a space - this is a zip code, for example SE41NA, and some can also be lowercase, for example SE41NAor se4 1na.
The query gives me different results based on saving the record. Is there any way I can handle this?
source
share