我们有一个表名(员工)&我们有列名Name,ID,Age。我想在sql&中创建程序。选择这种格式的数据我的页面aspx。 [英] WE have a table name (employee) & we have column name Name,ID,Age .i want to create procedure in sql & pick the data in this format my page aspx .

查看:97
本文介绍了我们有一个表名(员工)&我们有列名Name,ID,Age。我想在sql&中创建程序。选择这种格式的数据我的页面aspx。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个表名(员工)&我们有列名Name,ID,Age。我想在sql中创建过程并选择这种格式的数据我的页面aspx。在我的表中有不同的记录,例如。

Ashish 4次,amit 6次,mohit 2&now现在我要记录这种格式



ID名称



1 Ashish(4)

2 Mohit(2)

3 Amit(6)

WE have a table name (employee) & we have column name Name,ID,Age .i want to create procedure in sql & pick the data in this format my page aspx .suppose there r distinct record in my table eg .
Ashish 4 times , amit 6 times , mohit 2 & now i want to record this format

ID Name

1 Ashish (4)
2 Mohit (2)
3 Amit(6)

推荐答案

你可以使用group by子句。

查看此链接

http://www.w3schools.com/sql/sql_groupby.asp [ ^ ]
you can use group by clause.
check this link
http://www.w3schools.com/sql/sql_groupby.asp[^]


这篇关于我们有一个表名(员工)&我们有列名Name,ID,Age。我想在sql&中创建程序。选择这种格式的数据我的页面aspx。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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