What does select count (1) mean?

Source: Internet
Author: User
Count (1) is actually to calculate the total number of qualified rows. 1 does not represent the first field, but a fixed value. In fact, you can think of such a field in the table. This field is a fixed value of 1, count (1), that is, to calculate the total number of 1. similarly, count (2) can also be obtained. The obtained values are exactly the same. Count ('x') and count ('y') can be used. The same understanding. You can use this statement, and the returned values are the same. Is the count. Count (*). During execution, the asterisk is translated into the specific name of the field, and the effect is the same. However, an additional translation action is less efficient than a fixed value.


What does select count (1) mean?

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.