请教一个sql里的like的用法?
帮忙看一个SQL:
原始数据中有个一个icdcode的变量
ICDCODE
D00
D02
D03.9
D04
D04
D05
D67
D46
D27
D46.9
D11
D15
我的sql语句是:
select ICDCODE,iif(icdcode like "D[37-48]*","A","B") AS A
from TABLEBASE;
为啥D46查询出来的结果是B,而不是D37-D48的所有值都是A,正确的该怎么写?
------解决方案--------------------
只能匹配单一字符
select ICDCODE,iif(icdcode like "D[2-8]*","A","B") AS A
from TABLEBASE;
------解决方案--------------------