SQL Beginner Tutorial: Select top Use tutorial

Source: Internet
Author: User
Tags mssql

SQL Beginner Tutorial: Select top Use tutorial

OK, let's take a look at the syntax in select Top.

such as Mssql:select top from table_name

In Mysql:select * FROM table_name limit 0,10

SELECT Top Number|percent column_name (s) from
table_name

Let's take a look at an example tutorial.

Address City
_id LastName FirstName
1 Hansen Ola TIMOTEIVN 10 Sandnes
2 Svendson Tove BORGVN 23 Sandnes
3 Pettersen Kari STORGT 20 Stavanger
4 Nilsen Tom VINGVN 23 Stavanger

MSSQL or Access SELECT top 2 * from Persons
MySQL select * from persons limit 0,2
They output the same results as the following table.

Address City
Id LastName FirstName
1 Hansen Ola TIMOTEIVN 10 Sandnes
2 Svendson Tove BORGVN 23 Sandnes

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.