问题
I found out that CONVERT(object USING utf8) is for converting blob to text, but it doesn't seem efficient in the where clause, like this:
Select *
from Page
where CONVERT(Page.page_title USING utf8) = 'AccessibleComputing'
Is this the only way and the correct way? because it is taking too much time. Or should I convert 'AccessibleComputing' to binary in a way and then put it there?
回答1:
I tried this and it worked:
Select * from Page where Page.page_title = 'AccessibleComputing'
I think after all it doesn't need any conversion.
回答2:
Do these work?
Select *, CAST(Page.page_title AS CHAR(10000) CHARACTER SET utf8) AS Tmp
from Page
where Tmp = 'AccessibleComputing'
OR
Select *, CONVERT(Page.page_title USING utf8) AS Tmp
from Page
where Tmp = 'AccessibleComputing'
来源:https://stackoverflow.com/questions/28903599/mysql-query-check-the-blob-column-type-in-where-clause