因为我的表里面有英文字母开头的
这样就可以排除
select distinct substr(a.医保目录编码,0,4) from(
select y.* from yb_fymxxx_lyzyy y
where y.医保目录编码 in (SELECT t.医保目录编码 from yb_fymxxx_lyzyy t WHERE substr(t.医保目录编码,0,4) LIKE '33%' and substr(t.医保目录编码,0,4) not like '33A%' )) a
得到:
但是
我想求3302-3316内的
select distinct substr(a.医保目录编码,0,4) from(
select y.* from yb_fymxxx_lyzyy y
where y.医保目录编码 in (SELECT t.医保目录编码 from yb_fymxxx_lyzyy t WHERE substr(t.医保目录编码,0,4) LIKE '33%' and substr(t.医保目录编码,0,4) not like '33A%' )) a
where substr(a.医保目录编码,0,4) >= 3302 and substr(a.医保目录编码,0,4) <= 3316;
就会报错
我不是已经排除了字母吗?