如何删除mysql文本字段中的单引号'字符? [英] how to remove single quote ' character in mysql text field?

查看:27
本文介绍了如何删除mysql文本字段中的单引号'字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的查询:

SELECT count(email_details.id) as total_emails,
       email_titles.* 
  FROM email_details 
  LEFT JOIN email_titles ON email_details.email_title = email_titles.title 
 GROUP BY email_details.email_title 
 ORDER BY email_titles.id ASC

现在我的问题是 email_details.email_title 是 blob 字段,而 email_titles.title 是文本字段,这两个字段都有一个带有 ' 字符的数据,当我在没有 left join 的情况下运行此查询时说本月的视频",具有 ' 字符的行没有取回,如果我放左连接,那么它只检索第一个表数据.如何解决这个问题?

Now my problem is email_details.email_title is blob field and email_titles.title is text field, both field has a data with chracter say "this month’s video" when i runs this query without left join the row having chracter does not retrieve, if i put left join then it retrieves only first table data. how to solve this problem?

推荐答案

我自己解决了我的问题,我已经修改了这样的加入代码

I have solved my problem by my self, i have modified join code like this

LEFT JOIN `email_titles` ON CONVERT( email_details.email_title
USING utf8 ) = CONVERT( email_titles.title
USING utf8 ) 

这篇关于如何删除mysql文本字段中的单引号'字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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