Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Summarizing
groups of data: the compute clause [Table of Contents] Specifying more than one column after compute

Transact-SQL User's Guide

[-] Chapter 3 Using Aggregates, Grouping, and Sorting
[-] Summarizing groups of data: the compute clause
[-] Row aggregates and compute

Row aggregates and compute

The row aggregates used with compute are listed in Table 3-2:

How aggregates are used with a compute statement

Row aggregates

Result

sum

Total of the values in the expression

avg

Average of the values in the expression

max

Highest value in the expression

min

Lowest value in the expression

count

Number of selected rows

These row aggregates are the same aggregates that can be used with group by, except there is no row aggregate function that is the equivalent of count(*). To find the summary information produced by group by and count(*), use a compute clause without the by keyword.

Rules for compute clauses


Summarizing
groups of data: the compute clause [Table of Contents] Specifying more than one column after compute