求一条统计查询的SQL语句 表A如下:工单 制令号 不良代码GD001 1 NULLGD001 1 A01GD001 2 NULLGD002 1 B02要求统计表A中工单+制令号不重复的所有记录 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tb t where not exists(select 1 from tb where 工单=t.工单 and 制令号=t.制令号) 不知道对不对,可以试试select count(*) from(select distinct 工单,制令号 from A) T select count(*) as SUM from tb t where not exists(select 1 from tb where 工单=t.工单 and 制令号=t.制令号) select distinct 单号,制令号 from 表A这样不行? select 工单,制令号 from A group by 工单,制令号 select count(*) from A group by 工单,制令号 select count(*) from (select distinct 工单,制令号 from A) B 分组统计出来的不是总数量,yoyozo 的方法可行,结贴了 delphi Timage控件画虚框的问题 如何能快速把excel导入到数据库 寻求对文本日志处理方法 恭喜小虫喜获小小虫 求写一程序,一键关闭显示器和屏幕保护 这个功能是如何实现的,谁有代码? IdUDPServer问题,请高手指点! 如何在更新数据前加锁,更新后解锁。 ★★★请关注基于Delphi的强大三层框架,目前已经形成了一个活跃的用户群体 超级难题,自诩高手的过来看看,100分送上 请教各位高手,如何把Edit中的内容赋给fastreport中的reporttile中的Memo; 数据库现更新如何写,语句错误。
select count(*) from(select distinct 工单,制令号 from A) T