根据楼主的数据特点,字串两边加上 豆 号,再作比较.
注:以下是引用楼主的说法,其实不是 “等于”
SELECT COUNT(KSJH) 人数 FROM 表 WHERE OCCURS(",4,",","+ALLTRIM(KSJH)+",")>0
&& ksjh该字段 等于4 人数
SELECT COUNT(KSJH) 人数 FROM 表 WHERE OCCURS(",14,",","+ALLTRIM(KSJH)+",")>0
&& ksjh该字段 等于14 人数
KSJH等于4,或 等于14的 人数总和 SELECT COUNT(KSJH) 人数 FROM 表 WHERE OCCURS(",4,",","+ALLTRIM(KSJH)+",")>0 or OCCURS(",14,",","+ALLTRIM(KSJH)+",")>0
KSJH等于4,并且也等于14的 人数总和
SELECT COUNT(KSJH) 人数 FROM 表 WHERE OCCURS(",4,",","+ALLTRIM(KSJH)+",")>0 and OCCURS(",14,",","+ALLTRIM(KSJH)+",")>0
[
本帖最后由 kiff 于 2013-4-12 07:52 编辑 ]