mysql query control statements Field deduplication**Keyword: distinct** Syntax: select distinct field name from table name; Case: Deduplication of departments Select distinct dep from emp; ifnull syntaxNull plus any number equals null Use ifnull to replace null values Syntax: Select ifnull (field name that may be empty, if empty, replace it with something) from table name; Example: View the sum of an employee's monthly salary and commission Select sal+ifnull(comm,0) from emp; Aliasing fieldsMethod: select field name as alias from table name Select field name alias from table name Sorting: Keywords: order by Syntax: Select field name from table name order by field name (used for sorting) asc (ascending)/desc (descending) Aggregate functions:
Example: Total salary SummarizeThis is the end of this article about MySQL query control statements. For more relevant MySQL query control statements, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: JS array deduplication details
>>: Modify the default scroll bar style in the front-end project (summary)
If you’re looking for inspiration for columnar web...
After reinstalling the system today, I reinstalle...
Payment countdown to return to the home page case...
Summarize This article ends here. I hope it can b...
<br />When thoughts were divided into East a...
1. The concept of css: (Cascading Style Sheet) Ad...
Shopify Plus is the enterprise version of the e-c...
Structured Table (IExplore Only) 1) Group by rows ...
The data URI scheme allows us to include data in a...
This article example shares the specific code of ...
Table of contents What is insert buffer? What are...
This article shares the specific code for JavaScr...
Table of contents Overview Is the extension neces...
Preface To be honest, I've been feeling very ...
>1 Start the database In the cmd command windo...