如何不区分大小写更新列?
如果运行以下查询,它将按预期返回62条记录:
select entity_id
from field_data_body
where body_value like '%mailto:iss.servicedesk@example.com%';
返回62条记录
我尝试使用以下查询更新这些记录,将 iss.servicedesk@example.com
替换为 http://iss.servicedesk.example.com
:
update field_data_body
SET body_value = REPLACE(body_value,'%mailto:iss.servicedesk@example.com%',
'http://iss.servicedesk.example.com');
很不幸,由于运行的查询区分大小写,它只更新了52条记录,例如上面的查询中无法识别 Iss.Servicedesk@example.com
。
我该如何运行上述更新查询,但使其不区分大小写以获取我希望更新的所有表格?
我已更新下面的查询 - 它可以运行,但在我知道需要更新链接的情况下找不到任何结果:
update `field_data_body` SET `body_value` = REPLACE(body_value,'%mailto:iss.servicedesk@example.com%','https://iss.servicedesk.example.com')
where LOWER(CONVERT( body_value USING latin1)) like '%mailto:iss.servicedesk@example.com%'
有没有建议,告诉我应该做些什么来修复它以使其正确运行?
field_data_body
SETbody_value
= REPLACE(body_value,'%mailto:iss.servicedesk@example.com%','https://iss.servicedesk.example.com') where LOWER(CONVERT( body_value USING latin1)) like '%mailto:iss.servicedesk@example.com%' - frodofield_data_body
SETbody_value
= REPLACE(body_value,'%mailto:iss.servicedesk@example.com%','https://iss.servicedesk.example.com') where LOWER(CONVERT( body_value USING utf8)) like '%mailto:iss.servicedesk@example.com%',查询像以前一样运行,但没有更新任何记录...在不输入排序类型的情况下运行查询无效... - frodo