1.MYSQL basic single-table data lookup statement

Source: Internet
Author: User

1. Some functions , such as lower (lowercase), upper (uppercase), Initcap (capital letter). It is particularly understood that sum (a) is the sum of the computed A, and count (a) is the number of records that contain a, calculated as the total number of records.

2. Basic statement selete from where Groub by has order by

3. Execution order: from where the group by has a select order by which table is found first, then according to what is divided, and then displayed, and then in what order.

The Order of writing: It is the right to put the select first, because order by is displayed in what order, so always put the last side.

4.group by what points

5.having Two filter, which is the two-time selection after the where group

6.order by what order are they sorted,

7.where and having all are the screening functions that play a role, so what's the difference?

(1) Where is the filter before grouping, and having is grouped

(2) Having a grouping function, where there is no

(3) If the same can be achieved, it is recommended to use where, more efficient

1.MYSQL basic single-table data lookup statement

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.