mySql选择上/下

时间:2015-04-15 18:05:31

标签: mysql uppercase lowercase

我试图从两个表中编写一个选择,其中包含字符串的字段只在一个表中是UpperCase但查询和子查询似乎不起作用:

这有效:

SELECT City, Country
FROM Cities INNER JOIN Countries USING(IdCountry)
WHERE LOWER(Cities.City) IN
(LOWER('NEW YORK'), LOWER('PARIS'), LOWER('LONDON'))

这也有效:

SELECT LOWER(location) FROM locations

这不起作用:

SELECT City, Country
FROM Cities INNER JOIN Countries USING(IdCountry)
WHERE LOWER(Cities.City) IN
(SELECT LOWER(location) FROM locations)

我不明白错误

0 个答案:

没有答案