I have a query where I want to search for fields that ends with no.jpg
I have a table where some have file/no.jpg and some fields where it's only no.jpg
Now I would like to look for all that ends with no.jpg to find the fields where an image isn't added yet.
This almost what it looks like now, but I need help with how to write it correct.
SELECT * FROM table_img WHERE table_img.pic = 'file/no.jpg'
Is there any reason you have different values for "no image". If not I would update to just one image and then just query for that.
SELECT something, anything, just_not_the_dreaded_star FROM table_img WHERE table_img.pic = 'no.jpg' OR table_img.pic = 'file/no.jpg'
Just out of interest, would it be possible/make sense to use a reg exp?
SELECT the_dreaded_star FROM table_img WHERE table_img.pic REGEX 'no.jpg$'
I was thinking along the same lines, that or using RIGHT(table_img.pic, 5) = 'no.jpg'
I discovered that there weren't that many different ones, so I went in to the table and changed the the old ones to the new name instead. So, now I only need to look for one of them.
This topic is now closed. New replies are no longer allowed.