MSSQL The SUM() Function
페이지 정보
본문
The SUM() function returns the total sum of a numeric column.
SQL SUM() Syntax
SELECT SUM(column_name) FROM table_name
sql_sum = " SELECT SUM(price) AS exam FROM view_expenses_04d "
set rs_sum = dbcon.execute(sql_sum)
Do until rs_sum.EOF
exam = rs_sum("exam")
IF exam <> 0 then
exam = ex7_1
ELSE
exam = 0
END IF
rs_sum.Movenext
Loop
select sum(FieldA) as Total, [Date] from theTable Group By [Date]
select (fieldA + '' + fieldB) as fieldAB from table
참고자료
http://www.w3schools.com/sql/sql_func_sum.asp
http://forums.aspfree.com/microsoft-sql-server-14/the-sum-function-129001.html
SQL SUM() Syntax
SELECT SUM(column_name) FROM table_name
sql_sum = " SELECT SUM(price) AS exam FROM view_expenses_04d "
set rs_sum = dbcon.execute(sql_sum)
Do until rs_sum.EOF
exam = rs_sum("exam")
IF exam <> 0 then
exam = ex7_1
ELSE
exam = 0
END IF
rs_sum.Movenext
Loop
select sum(FieldA) as Total, [Date] from theTable Group By [Date]
select (fieldA + '' + fieldB) as fieldAB from table
참고자료
http://www.w3schools.com/sql/sql_func_sum.asp
http://forums.aspfree.com/microsoft-sql-server-14/the-sum-function-129001.html
댓글목록
등록된 댓글이 없습니다.