SQL function description

Source: Internet
Author: User
SQL function description: Once data is successfully retrieved from a table, you need to further manipulate the data to obtain useful or meaningful results. These requirements include execution of computation and mathematical operations, conversion of data, resolution of numerical values, combination of values and values within the aggregation range. The following table lists the classes and descriptions of T-SQL functions. Function category function Aggregate Function

SQL function description: Once data is successfully retrieved from a table, you need to further manipulate the data to obtain useful or meaningful results. These requirements include execution of computation and mathematical operations, conversion of data, resolution of numerical values, combination of values and values within the aggregation range. The following table lists the classes and descriptions of T-SQL functions. Function category function Aggregate Function

SQL function description

Once the data is successfully retrieved from the table, you need to further manipulate the data to obtain useful or meaningful results. These requirements include execution of computation and mathematical operations, conversion of data, resolution of numerical values, combination of values and values within the aggregation range.

The following table lists the classes and descriptions of T-SQL functions.

Function category

Function

Aggregate functions

The operation is to merge multiple values into one value. For example, COUNT, SUM, MIN, and MAX.

Configuration Functions

Is a scalar function that returns information about configuration settings.

Conversion functions

Converts a value from one data type to another.

Encryption Functions

Supports encryption, decryption, digital signature, and digital signature verification.

Cursor Functions

Returns information about the cursor status.

Date and Time Functions

You can change the date and time values.

Mathematical functions

Perform triangle, geometric, and other numeric operations.

Metadata Functions

Returns the attributes of the database and database objects.

Ranking Function

Is a non-deterministic function that returns the ranking value of each row in a partition.

Collection Functions

Returns the row set that can be referenced by a table in a Transact-SQL statement.

Security Functions

Returns information about users and roles.

String Functions

You can change the values of char, varchar, nchar, nvarchar, binary, and varbinary.

System Functions

Operate or report system-level options and objects.

System statistical functions

Returns information about SQL Server performance.

Text and image Functions

You can change the value of text and image.

Function composition

The objective of the function is to return a value. Most functions return a scalar value, which represents a data unit or a simple value. In fact, a function can return any data type, including tables, cursors, and Other types that can return a complete multi-row result set. This chapter does not discuss the depth, website space, and Hong Kong virtual hosts. Chapter 12th describes how to create and use user-defined functions to return more complex data.

The function has existed for a long time, and its history is longer than that of SQL. In almost all programming languages, the website space and function call methods are the same:

Result = Function ()

In T-SQL, SELECT statements are generally used to return values. If you need to return a value from the query, you can use SELECT as the output operator, instead of using the equal sign:

SELECT Function ()

An argument

For SQL functions, parameters represent placeholders of input variables or values. A function can have any parameter. Some parameters are required, while some parameters are optional. Optional parameters are usually placed at the end of a comma-separated parameter table to facilitate the removal of unnecessary parameters in function calls.

In SQL Server online books or online help systems, optional function parameters are represented in square brackets. In the following CONVERT () function example, the length and style parameters of the data type are optional:

CONVERT (data-type [(length)], expression [, style])

You can simplify it to the following format because we do not discuss how to use data types:

CONVERT (date_type, expression [, style])

According to the above definition, the CONVERT () function can accept two or three parameters. Therefore, the following two examples are correct:

Select convert (Varchar (20), GETDATE () select convert (Varchar (20), GETDATE (), 101)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.