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 ASP PHP ecommerce web development India