Low cost ecommerce web development India flash website design

Calculated Values and the GROUP BY Clause

Transact-SQL (T-SQL) contains a number of functions to calculate values. A

calculated value is a result of an operation on one or more columns in

multiple rows. For example, a sum, average, or total. In T-SQL, calculated

values are called aggregates, and the functions are aggregate functions

because they aggregate, or collect a number of values into a single value using

a calculation. For example, yea can retrieve the total number of rows in any

table with the following SELECT statement, substituting an appropriate table

name in the FROM clause:

SELECT count(*) FROM <tab1ename>

The syntax of the GROUP BY clause is:

SELECT (fieldl [, fie1d2] ...)

FROM (table1 [, table2] ...)

WHERE (condition)

GROUP BY (fieldl [, fie1d2] ...)

HAVING (condition)

ORDER BY (fieldl [ASC|DESC] [, fie1d2 [ASC|DESC]] ...)

You've seen the rudiments of how to select data. Selecting data doesn't change

it, so selecting is a safe operation. All the other statements change data in

some way. You'll be happy to know that the other statements are considerably

less complex than the SELECT statement. I suggest you make a backup copy

of your database before you continue.

freelance web designer India web development

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73