How to get max number in a column?(如何获得列中的最大数量?)
问题描述
我一直在尝试查找如何在列中获取最大数量的示例.我想要做的是,在 TABLE_A 中找到一列的最大数量,点(列).例如,我想输出这个 MAX 数
I'm been trying to find a example of how to get a max number in a column.What I want to do is, find the MAX number of a column in a TABLE_A, points(column). I want to output this MAX number for example
<cfoutput>
<tr>
<th><div align="right">#maxnumber#</div></th>
</tr>
</cfoutput>
不确定这是否是输出方式,但我只想要一个数字(MAX),而不是列的数组.
Not sure if this is the way to output, But I just want one number(the MAX) , not an array of the column.
感谢您的帮助,ColdFusion 新手.
thanks for your help, new to ColdFusion.
推荐答案
你可以做这样的事情来从你的查询中获取顶部的 X,然后相应地输出它们
You can do something like this to get the top X from your query and then output them accordingly
<cfquery name="maxQuery">
SELECT TOP 2 points
FROM table_a
ORDER BY points DESC
</cfquery>
<cfoutput query="maxQuery">
#maxQuery.currentRow# - #maxQuery.points#<br>
</cfoutput>
这篇关于如何获得列中的最大数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何获得列中的最大数量?
基础教程推荐
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 在多列上分布任意行 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
