A
A
Alexander Vishnev2018-04-28 19:06:27
MySQL
Alexander Vishnev, 2018-04-28 19:06:27

How to remove all rows starting with zero from a table?

I execute a query to the database via PMA: DELETE FROM usrcfg WHERE idname LIKE "^[0]"; to remove all entries in the idname column starting with "0", the query runs without errors, but rows with a leading zero are not removed. Where is the mistake?
Example of entries in the idname column:
0-username1
1-username1
0-username2
3-username1
0-username3

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
My joy, 2018-04-28
@fromdns

DELETE FROM usrcfg WHERE idname LIKE '0%';

D
Dmitry, 2018-04-28
@demon416nds

like is not a regex

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question