统计查询记录的总数

yswang3xdj 2007-11-20 05:53:56
select cableName,bairPress from currentcabledata where to_number(bairPress)>1580 and bureauname='玉桥营维'
上面是2个字段的一个收索我要通过统计这2个字段同时不重复的记录总数
...全文
141 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
hongqi162 2007-11-27
  • 打赏
  • 举报
回复
加一个group by就可以了


select cableName,bairPress from currentcabledata where to_number(bairPress)>1580 and bureauname=玉桥营维'
group by cableName,bairPress
Croatia 2007-11-27
  • 打赏
  • 举报
回复
看起来,就是需要一个group by 呀。
bugchen888 2007-11-27
  • 打赏
  • 举报
回复
SELECT Count(DISTINCT cable_name||bairPress) AS cnt
FROM currentcabledata
WHERE To_Number(bairPress)> 1580
AND bureauname= '玉桥营维'
tjinjie 2007-11-27
  • 打赏
  • 举报
回复
楼主是不是想要查出cableName, bairPress这两个字段组合起来不重复的数据啊???
select cableName, bairPress, count(1)
from currentcabledata
where to_number(bairPress) > 1580
and bureauname = '玉桥营维 '
group by cableName, bairPress
having count(1) = 1
HelloWorld_001 2007-11-20
  • 打赏
  • 举报
回复
楼住的意思是group by 吗?
select cableName,bairPress,count(*) from currentcabledata
where to_number(bairPress)> 1580 and bureauname= '玉桥营维 '
group by cableName,bairPress

最好给点数据和你想要的结果.
chendezhu1985 2007-11-20
  • 打赏
  • 举报
回复
可以把数据发出来看看吗?

17,082

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧