SQL Server Functions (1/16)

Source: Internet
Author: User
This section adds a large number of sqlserver functions to an article, from simple SQL query functions, character processing functions, stored procedure functions, statistics, and character truncation functions, date functions.

This section adds a large number of SQL server functions to an article, from simple SQL query functions, character processing functions, stored procedure functions, statistical calculations, and character truncation functions, date functions.

This section adds a large number of SQL server functions to an article, from simple SQL query functions, character processing functions, functions, statistics, and character truncation functions.

SQL server Functions
-- Aggregate functions
Use pubs
Go
Select avg (distinct price) -- calculate the average
From titles
Where type = 'business'
Go
Use pubs
Go
Select max (ytd_sales) -- maximum number
From titles
Go

Use pubs
Go
Select min (ytd_sales) -- Minimum Number
From titles
Go

Use pubs
Go
Select type, sum (price), sum (advance) -- sum
From titles
Group by type
Order by type
Go

Use pubs
Go
Select count (distinct city) -- calculate the number
From authors
Go

Use pubs
Go
Select stdev (royalty) -- returns the statistical standard deviation of all values in a given expression
From titles
Go

Use pubs
Go
Select stdevp (royalty) -- return the standard deviation of filling Statistics for ownership in the expression
From titles
Go

Use pubs
Go
Select var (royalty) -- returns the statistical variance of all values
From titles
Go

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.