这个查询还是不会写? select * from tablename where 产品 in(select 产品 from tablename group by 产品 having max(结算情况)=0) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 declare @tab table(产品 varchar(20),结算情况 bit,金额 int)insert @tab values('0001',0,100)insert @tab values('0001',1,50)insert @tab values('0002',0,100)insert @tab values('0002',0,100)select * from @tabselect * from @tab where 产品 not in(select 产品 from @tab where 结算情况=1) select * from ABCwhere 产品 not in (select distinct 产品 from ABC where 结算情况=1) Select * from tablename where 产品 not in (select 产品 from tablename where 结算情况=1) 我是这么写的select * from ABC where b=0 and a not in (select a from ABC where b<>0)哪一个效率高啊 select * from ABCwhere 产品 not in (select distinct 产品 from ABC where 结算情况=1) select * from ABCwhere 产品 not in (select distinct 产品 from ABC where 结算情况=1) 在PowerDesigner中如何定义SQL Server 的SCHEMA 散分??? 邹建大哥你好,求助你一个SQL Server 2005 复制同步的问题。谢谢! 判断更新数据? 日志里面全部是用户sa登录失败,有啥办法找出是哪个程序请求连接的吗? [求助]如何让update语句自动给某int列的数值 +1? 备份出现的问题,高手请指教 怎么样进行连接 装什么版本的sql server 2005 来解决我的问题 数据库初学者的问题 请问怎样获取SQL语句中的记录 在企业管理器中,怎么注册服务器的???
insert @tab values('0001',0,100)
insert @tab values('0001',1,50)
insert @tab values('0002',0,100)
insert @tab values('0002',0,100)
select * from @tabselect * from @tab where 产品 not in(select 产品 from @tab where 结算情况=1)
from ABC
where 产品 not in (select distinct 产品 from ABC where 结算情况=1)
not in (select 产品 from tablename where 结算情况=1)
select * from ABC where b=0 and a not in (select a from ABC where b<>0)哪一个效率高啊
from ABC
where 产品 not in (select distinct 产品 from ABC where 结算情况=1)
from ABC
where 产品 not in (select distinct 产品 from ABC where 结算情况=1)