SQL Server Basic Syntax

Source: Internet
Author: User
Tags sorted by name

1.DISTINCT returns the only difference is the value
2.where extract records that meet subsequent conditions
3.and & OR and & or
4.insert into the table to insert a new record
5.update updating records in a table
6.delect delete records in a table
7.select top Specifies the number of records to return
Select limit Specifies the start and number of rows for a query
Column: SELECT * FROM table limit 5,10;//return 第6-15 rows
Select RowNum (1) Select Rownum,id,name from student where rownum=1;//returns the records of Rownum=1 columns
(2) Select Rownum,id,name from student where rownum<3;//returns the record of the rownum=1,2 column
(3) SELECT * FROM (select RowNum No, id,name from student) where no>2;//returns records for columns with rownum greater than 2
(4) SELECT * FROM (select RowNum no,id,name from student where rownum<=3) where no >=2;//returns records for a range
(5) Select RowNum, Id,name from (SELECT * from Student order by name);//Generate rownum column sorted by name

SQL Server Basic Syntax

Related Article

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.