I have the following table images:
images
+----+--------------+ | id | img_path | +----+--------------+ | 1 | abc_1.jpg | | 2 | abc_2.jpg |
Found out that _ is a special character. Have to escape with backslashes.
_
SELECT id FROM images WHERE img_path LIKE 'abc\_%'
which returns 2 rows as expected