MySQL:查找列值以特定子字符串结尾的行 [英] Mysql: Find rows where column value ends with a specific substring

查看:876
本文介绍了MySQL:查找列值以特定子字符串结尾的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列url,其中所有值都是url.我正在尝试更新其他列的值,无论上述url以.pdf结尾.

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.

有人可以帮我吗?在SO上,我还没有找到答案.

Can anyone help me with this? I haven't found an answer here on SO.

推荐答案

我可能会过于简化...但是根据您的描述,

I might be oversimplifying... but based on your description, would LIKE solve your problem?

UPDATE YourTable
SET DifferentColumn = 'NewValue'
WHERE Url LIKE '%.pdf'

这篇关于MySQL:查找列值以特定子字符串结尾的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆