4-sql Advanced Tutorials

Source: Internet
Author: User

1 TOP clause

The TOP clause is used to specify the number of records to return.

Syntax for SQL Server:
SELECT TOP number| ( PERCENT ) column_name (s) from table_name
MySQL syntax
SELECT column_name (s) from Table_namelimit number
Oracle syntax
SELECT column_name (s) from Table_namewhere ROWNUM <= number

2 Like operator

The LIKE operator is used to search for a specified pattern in a column in a WHERE clause .

3 SQL wildcard characters

Wildcard description% replaces one or more characters _ replaces only one character [charlist] Word columns any single character

[^charlist]

Or

[!charlist]

Any single character that is not in the word columns

4 in operator

The in operator allows us to specify multiple values in the WHERE clause .

5 between operator

operator between ... and selects a range of data between two values. These values can be numeric, text, or date .

SQL between syntax
SELECT column_name (s) from Table_namewhere column_name
(NOT)|
Between Value1 and value2

6 SQL alias syntax for SQL alias table
SELECT column_name (s) from Table_nameas Alias_name
SQL Alias syntax for columns
SELECT column_name as Alias_namefrom table_name


4-sql Advanced Tutorials

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.