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)
background On mobile devices, caching between pag...
Find the problem When retrieving the top SQL stat...
The CentOS Project, a 100% compatible rebuild of ...
This article shares with you a detailed tutorial ...
This article shares the specific code of Vue usin...
Disclaimer: This password reset method can direct...
Today, this article has collected 30 excellent cas...
Table of contents Preface 1. Install the service ...
<br />Recently, UCDChina wrote a series of a...
All prerequisites require root permissions 1. End...
Recently, the project uses kubernetes (hereinafte...
This article shares the specific code of native j...
Preface: I recently started to study the construc...
Mysql is a mainstream open source relational data...
Event bubbling, event capturing, and event delega...