I have a column url
where all the values are urls. I\'m trying to update the value of a different column where-ever the aforementioned url ends with .pdf
In your WHERE clause, use something like LOCATE('.pdf',url) > 0
to identify the record of interest.
As pointed out, this will give you any url that contains '.pdf' in the string...
If you definitely want the '.pdf' to be at the end, you can also try:
LOWER(RIGHT(url,4)) = '.pdf'
I would use LOWER or UPPER to deal with any case issues.
You can also use LIKE %.pdf
(again, watch out for upper/lower case issues) as suggested
by others.