本文介绍了MySQL中奇怪的Ascii字符.需要查询将其删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找出如何从mySQL数据库中删除字符Â的方法.别人做得不好,已经为我转换了.

I am trying to work out how to remove the character  from a mySQL database. It has been converted for me by someone else who hasn't done a great job.

表是ps_product_lang

table is ps_product_lang

字段是描述AND description_short

fields are description AND description_short

我认为我的查询应该是

更新ps_product_lang设置描述= replace(description,'Â','’)

update ps_product_lang set description = replace(description, ‘Â’, ‘’)

但是我应该把Â放在哪里?当我尝试进行搜索时,它会找到每个'a'.

But what should I put in where the  is? When I try to do a search it finds every 'a'.

ASCII码182 =Â(带抑扬音符号或A-抑扬音符号的字母A)(HTML实体=Â)

ASCII code 182 = Â ( Letter A with circumflex accent or A-circumflex )( HTML entity = Â )

谢谢您的建议.

推荐答案

CHAR(182)与整数代码182的字符匹配.

CHAR(182) matches the character that is integer code 182.

因此您可以执行以下操作:

So you can do this:

update ps_product_lang set description = replace(description, CHAR(182), '')

CHAR()的文档在此处

Documentation for CHAR() is here

这篇关于MySQL中奇怪的Ascii字符.需要查询将其删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 14:04