MySQL notes (ii)

Source: Internet
Author: User

One, DQL statements
1. Constant column
SELECT
' Studentname ' as the name,
' Address ' as,
' Beijing Information Center ' as school name
From ' student ';
2. Common functions
Aggregation functions
AVG () averaging points
COUNT () Statistics Record count
SELECT COUNT (1) from student; High efficiency
Select COUNT (*) from student;
Max () max value
Min () Min value
SUM () sum
String functions:
Date function:
Curdate ();
#获取随机数
Select Floor (RAND () *10);
3. Sort Query
ORDER BY [Desc]

4. * Paging Query
Limit
5, sub-query

Comparison operators (such as >, =, <, >=, <=, and so on) can return only one value

In and not in can return multiple single-segment values.
Execute the subquery first and then execute the parent query

MySQL notes (ii)

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.