I have a table cities:
+----+--------+
| id | zip |
+----+--------+
| 1 | 07500 |
| 2 | 07501 |
| 3 | 75000 |
| 4 | 75001 |
| 5 | 75002 |
+----+--------+
And I need to select data where the field zip start with 750, so I’ve tried :
SELECT FROM cities WHERE ZIP LIKE '%750%'
But this returns me all data in the table that contain 750 and this isn’t normal. How could I tell my query to select data that start with 750 ?
Do this query:
Explanation
%is a special MySQL character that means any character, empty string or group of characters.Examples: