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>
这篇关于如何获得列中的最大数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何获得列中的最大数量?


- 在SQL中,如何为每个组选择前2行 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- SQL 临时表问题 2022-01-01