请教sql语句(10分)

  • 主题发起人 主题发起人 南宫吹云
  • 开始时间 开始时间

南宫吹云

Unregistered / Unconfirmed
GUEST, unregistred user!
我想选出一个表中某个字段的值出现次数最多的这个字段和次数,我写如下语句出错:
select max(xx) from (select xx=count(pro_bianhao) from xforde group by pro_bianhao)
 
select max(xx) from (select xx=count(pro_bianhao) from xforde group by pro_bianhao) as t
 
应该如下:
select max(xx) from (select count(pro_bianhao) as xx from xforde group by
pro_bianhao) as bb
我试了一下,可以的
 
多谢两位!!
 
后退
顶部