Monday, July 13, 2015

TSQL Built-in Functions

Built-in Functions (T-SQL)

Function
Description
Rowset Functions
Return an object that can be used like table references in an SQL statement.
Aggregate Functions
Operate on a collection of values but return a single, summarizing value.
Ranking Functions
Return a ranking value for each row in a partition.
Scalar Functions
Operate on a single value and then return a single value.
Scalar functions can be used wherever an expression is valid.
 
Rowset Functions (Transact-SQL)

OPENDATASOURCE
OPENROWSET
OPENQUERY
OPENXML
Aggregate Functions
AVG
MIN
CHECKSUM_AGG
SUM
COUNT
STDEV
COUNT_BIG
STDEVP
GROUPING
VAR
GROUPING_ID
VARP
MAX
SQL Server provides many built-in functions and also provide you ability to create user-defined functions. The categories of built-in functions are listed.

SQL Server 2012
The following rowset functions return an object that can be used in place of a table reference in a Transact-SQL statement.
Aggregate functions perform a calculation on a set of values and return a single value. Except for COUNT, aggregate functions ignore null values. Aggregate functions are frequently used with the GROUP BY clause of the SELECT statement.
All aggregate functions are deterministic. This means aggregate functions return the same value any time that they are called by using a specific set of input values.The OVER clause may follow all aggregate functions except GROUPING and GROUPING_ID.
Aggregate functions can be used as expressions only in the following:
·         The select list of a SELECT statement (either a subquery or an outer query).
·         A HAVING clause.
Transact-SQL provides the following aggregate functions:
AVG
MIN
CHECKSUM_AGG
SUM
COUNT
STDEV
COUNT_BIG
STDEVP
GROUPING
VAR
GROUPING_ID
VARP
MAX




No comments:

Post a Comment