求个sql语句 有个表a中有字段b 和c 格式均为 dd,ee,cc.....求个sql语句 要求 查询表a中 b字段含有dd,c字段不含有dd的记录的个数 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select count(*) from 表a a where exists(select 1 from 表a where b=dd and c<>dd) select count(*) from 表a where where b=dd and c<>dd 字段是格式为dd,ee,ff...的varchar类型 就是不知道该怎么写 b字段含有dd而c字段不含有dd trySELECT COUNT(1) FROM tb WHERE CHARINDEX('dd',b)>0 AND CHARINDEX('dd',c)=0 select count(*) from 表a where where b like '%dd%' and c not like '%dd%' select count(*) from a where charindex('dd',b)>0 and charindex('dd',c)<0 要求 查询表a中 b字段含有dd,c字段不含有dd的记录的个数==>select count(*) as v_countfrom awhere charindex(',dd,',','+b+',')>0 and charindex(',dd,',','+c+',')=0 外键约束,导致不能修改表怎么办 谁有考勤管理的报表查询语句 SQLserver数据库之间同步的几个问题 菜鸟提问,高手来啊 问一个很白吃的问题,请大侠帮忙 求一条Sql语句的写法。 超级郁闷, 我这样查出来的表记录与另一方法查出来表记录却不一致,怎么回事啊? 请问怎样把本地数据库传到网上去呢? 想把MySQL数据库复制到MS SQL下(只复制结构) 请问哪位知道怎么制作VFP发布程序的帮助文件啊,具有像一般软件的帮助一样的功能 的?谢谢 求sql 两个表查询的问题 字符串攫取問題?
就是不知道该怎么写 b字段含有dd而c字段不含有dd
select count(*) from a where charindex('dd',b)>0 and charindex('dd',c)<0
==>
select count(*) as v_count
from a
where charindex(',dd,',','+b+',')>0
and charindex(',dd,',','+c+',')=0