我想查找两个加拿大邮政编码之间的所有记录。
我用过:
SELECT count(*) as target FROM `subscribers` WHERE (zipcode BETWEEN "A0A1A0" AND "A0A2A9" )
这个查询没有给我正确的输出。有人可以帮忙吗?
答案 0 :(得分:0)
如果正确分配了邮政编码,您可以使用不带()
的查询SELECT count(*) as target
FROM `subscribers`
WHERE zipcode BETWEEN "A0A1A0" AND "A0A2A9" ;
最终你不能执行修剪以删除隐形字符
SELECT count(*) as target
FROM `subscribers`
WHERE trim(zipcode) BETWEEN "A0A1A0" AND "A0A2A9" ;