Professional Documents
Culture Documents
TCS Internal 1
Objective
TCS Internal 2
Scope
TCS Internal 3
Retrieving Rows (Based On Comparisons)
TCS Internal 4
Retrieving Rows (Based On Ranges)
TCS Internal 5
Retrieving Rows (Based On Lists)
TCS Internal 6
Eliminating the duplicates
The default result is to show all the rows which satisfy the WHERE clause.
If only distinct values are required for a particular combination of columns, the
keyword DISTINCT is used
TCS Internal 7
Sorting the Results
The ORDER BY Clause defines the particular order of the rows in the result of a
query.
Syntax:
TCS Internal 8
Aggregate Functions
Aggregate are functions that are used to get summary values. All aggregate
functions can be divided into three groups:
TCS Internal 9
Convenient Aggregates
MIN
MAX
SUM
AVG
COUNT
COUNT_BIG
TCS Internal 10
Statistical Aggregates
VAR
VARP
STDEV
STDEVP
TCS Internal 11
Super Aggregates
CUBE
ROLLUP
TCS Internal 12
Temporary Tables
A temporary table is a special kind of a table that differs in two ways from base
tables.
Local temporary tables are removed at the end of the current session. They are
specified with the prefix #.
Global temporary tables are dropped at the end of the current session. They
are specified with the prefix ##.
TCS Internal 13
Computed Columns
Computed Columns are (by default) virtual columns not physically stored in the table.
Their values are recalculated each time they are referenced in a query.
Example:
TCS Internal 14
Summary
TCS Internal 15