此查询需要SQL查询 [英] SQL Query needed for this requirement

查看:77
本文介绍了此查询需要SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的表

表名ssssss

在该列名中r

I have table like this
table name ssssss
in that column names r

state     coverage
 aa         a1
 aa         a2
 aa         a3
 bb         a1
 bb         a4
 cc         a1
 cc         a6



这里的州名是aa,bb,cc和aa有3个报道

bb有2个报道

cc有2个报道

我们想要哪个州最大没有覆盖范围,有计数



喊叫删除[/编辑]


here state names are aa,bb,cc and aa having 3 coverage
bb having 2 coverages
cc having 2 coverages
inthat we want which state have maximum no of coverages , with count

Shouting removed[/Edit]

推荐答案

尚未尝试过必须关闭...

have not tried must this should be close...
select top 1 state, count(coverage) as cnt
from ssssss
group by state
order by  count(coverage) desc 


这篇关于此查询需要SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆