Difference between count (1), count (*), order by 1, 2, 3, and 4

Source: Internet
Author: User

Images and truth

1. Create NULL data;

2. Use the column name to view the results under COUNT.

3. Use 1, 2, 3, 4, 5 * to COUNT and check that all data is the same as all functions.

4 order by 1 do use the first column for sorting

5 order by 2 check that the result is correct

Result:

Count (1) = count (2) = count (3) = count (*);

Count (provcode) <> count (areacode) <> count (statedate) <> count (*);

Order by 1 <> order by 2 <> oreder by 3;

Order by 1 = orderby provcode

Additional results:

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.