Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含内容编号的表格。我想从表的每一行添加值:
table name: item columns: item_name, item_price.
如何总结item_price列中的值?
item_price
这取决于您使用的数据库,但语法类似于:
SELECT SUM( item_price) FROM item
有了 CF,我们开始
<cfset TotalItemPrice = 0> <cfoutput query="myQrt"> <cfset TotalItemPrice = TotalItemPrice + item_price> </cfoutput> <cfoutput>#TotalItemPrice#</cfoutput>