brad62 — 2012-10-04T08:11:00-04:00 — #1
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'
scallioxtx — 2012-10-04T08:35:15-04:00 — #2
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'
pullo — 2012-10-04T08:38:54-04:00 — #3
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$'
cpradio — 2012-10-04T08:50:37-04:00 — #4
I was thinking along the same lines, that or using RIGHT(table_img.pic, 5) = 'no.jpg'
brad62 — 2012-10-04T09:09:30-04:00 — #5
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.