web tools rank checker

domain .cn
.net .cn .com.cn
你正在阅览 :: 简体中文:: 学习 ASP SQL VB HTML code

学习 .ASP SQL HTML XML CSS JAVA Perl code study
English Chinese_Traditional Chinese_Simplified

你正在阅览 :: 简体中文 Chinese_Simplified

学习.主题:
首页
ASP
CSS
Ecommerce
HTML
InternetProtocol
JAVA
Microsoft
Robots
SearchEngine
SQL
. Count
. Select
»SUM
»top
SQLserver
VBscript
XML

SiteMap

3w....学习.教学 > SQL > select » sum

3w learning

select >
sum

Title:

get sum of a field


Description:

select sum(field name) as anotherName from table where ....


Example Code:

id product size price 1 Shorts M 2.99 2 T-Short XL 3.99 3 Shorts M 5.3 <% query=request("query") 'ex: query="M" fieldQuery=request("fieldQuery") 'ex: fieldQuery="Size" DIM SQL, RS, conn SQL="SELECT SUM(price) AS sumTotal from TB where "&fieldQuery&"='"&query&"' " Set RS = Server.CreateObject("ADODB.Recordset") RS.Open SQL,conn sumTotal= rs("sumTotal") rs.close response.write sumTotal %>


Example Result:


result: 8.29


..
...
...

[ 8/28/2008 ]

www learning school add more scripts and tips memo
You are at >>3WS.EZER.COM >> 3WS.EZER.COM/SQL/SELECT/SUM.ASP>>SQL
Helpful link:: SEO web tools :: Live PR | SERP checker
back to top Ezer code adding :: Questions ;email