mySQL Replace不替换第二个令牌

时间:2014-03-11 09:14:46

标签: mysql

我有以下查询:

SELECT BUSINESS_NAME, 'KEYWORD', REPLACE(BUSINESS_NAME, ' ', '-')
FROM clearindia.business b
LEFT OUTER JOIN `clearindia`.`keywords_master` km ON km.KEYWORD_TEXT = b.BUSINESS_NAME
WHERE km.KEYWORD_TEXT IS NULL
AND b.business_name='Dey Radio Service'
GROUP BY BUSINESS_NAME

它给了我以下结果:

  # BUSINESS_NAME, KEYWORD, REPLACE(BUSINESS_NAME, ' ', '-')
  'Dey Radio service', 'KEYWORD', 'Dey-Radio service'

REPLACE(BUSINESS_NAME,'',' - ')工作不正常,不会用' - '替换第二个空格。那是为什么?

请注意:BUSINESS_NAME的归类为utf_unicode_ci。

0 个答案:

没有答案