从数据库中获取最大值,并且该最大值应在gridview中显示为所有行的单独列 [英] to get max value from database and that max value should show as a separate column in gridview to all rows
本文介绍了从数据库中获取最大值,并且该最大值应在gridview中显示为所有行的单独列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
从数据库获取最大值,并且最大值应该在gridview中显示为所有行的单独列,通过select query
to get max value from database and that max value should show as a separate column in gridview to all rows by select query
推荐答案
在sql中使用max,数据将在一列中显示在你的网格中。
从y中选择max(x)
Use max in your sql, and the data will be in a column and show in your grid.
Select max(x) from y
查询应该是这样的:
选择*,(从emp中选择MAX(薪水))作为来自emp的maxsalary
query should be like this :
select *,(select MAX(salary) from emp) as maxsalary from emp
这篇关于从数据库中获取最大值,并且该最大值应在gridview中显示为所有行的单独列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文