如何对临时表中的数据进行分组

发布于 2024-07-23 10:27:21 字数 114 浏览 8 评论 0原文

我创建了一个临时表,其中对应于一个作为主键的 fileid,我有 5 行。 我想要得到的计数为 5。我必须编写什么查询才能获取与每个 fileid 对应的计数?

I have created one temporary table in which corresponding to one fileid which is primary key, I am having 5 rows. I want to get the count as 5. What query do I have to write to get the count corresponding to each fileid?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

硪扪都還晓 2024-07-30 10:27:21
Select id, count(*) from #tmpTable
Group by id
Select id, count(*) from #tmpTable
Group by id
謌踐踏愛綪 2024-07-30 10:27:21
Select Count(Primary_Key_Field) as PrimaryFieldCount, Primary_Key
From TmpTbl
Group by Primary_Key
Select Count(Primary_Key_Field) as PrimaryFieldCount, Primary_Key
From TmpTbl
Group by Primary_Key
波浪屿的海角声 2024-07-30 10:27:21
SELECT
     GroupByField,
     COUNT(*)
FROM 
     #TableName
GROUP BY
    GroupByField
SELECT
     GroupByField,
     COUNT(*)
FROM 
     #TableName
GROUP BY
    GroupByField
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文