TSQL模式(以均值,中位数,模式表示)

TSQL模式(以均值,中位数,模式表示),第1张

TSQL模式(以均值,中位数,模式表示)

模式是最常见的值。您可以通过聚合和获得此信息

row_number()

select idsOfInterest, valueOfInterestfrom (select idsOfInterest, valueOfInterest, count(*) as cnt,  row_number() over (partition by idsOfInterest order by count(*) desc) as seqnum      from table t      group by idsOfInterest, valueOfInterest     ) twhere seqnum = 1;


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5620519.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-15
下一篇2022-12-15

发表评论

登录后才能评论

评论列表(0条)

    保存