SQL更新与LIKE [英] SQL UPDATE with LIKE
本文介绍了SQL更新与LIKE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图通过使用这样的语句,更新大约20,000记录在表中,
然而,我有消息说 0行受影响
I was trying to update approx 20,000 records in a table by using statements like this one,
however, I got the message say 0 row(s) affected
so it didn't work.
UPDATE nc_files SET title ="Worklog details" WHERE "log_name" LIKE "%PC01%"
log_name
具有混合文件扩展名和大小写的名称,例如
The log_name
field has all the file names with mixed file extensions and cases ,e.g.
PC01.TXT | Worklog details
PC02.txt | Project Summary
PC03.DOC| Worklog details
PC04.doc| Project Summary
我需要使用 LIKE
是更新的文件只有没有扩展名的文件名,例如
The reason why I need to use LIKE
is that the updated file only have file name without extension, e.g.
PC01 | Worklog details
PC02 | Project Summary
如何使用 LIKE
推荐答案
log_name
是字段名称,
UPDATE nc_files SET title ="Worklog details" WHERE log_name LIKE "%PC01%"
这篇关于SQL更新与LIKE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文