1. Basic grammarSELECT Query list FROM Table name WHERE filter expression; 2. Filter by conditional expression Conditional operators: #Filter all information of employees whose salary is greater than 12000 in the employees table SELECT * FROM employees WHERE salary>12000; 3. Filter by logical expression Logical operators: SELECT * FROM employees WHERE salary>12000 AND salary<16000; 4. Fuzzy query Keywords: ①like: Usually used with wildcards. Wildcards: #Query all information of employees whose second letter of name is aSELECT * FROM employees WHERE last_name LIKE '_a%'; ②between and: contains two critical values. Note that the order of the two critical values cannot be reversed. SELECT * FROM employees WHERE salary BETWEEN 10000 AND 16000; ③in: Determine whether the value of a field belongs to an item in the in list. Wildcards are not supported. #Query all information of employees with job numbers SA_MAN and PR_REPSELECT * FROM employees WHERE job_id IN('SA_MAN','PR_REP'); ④is null (is not null): is empty and not empty #Query all information of employees without bonus SELECT * FROM employees WHERE commission_pct IS NULL; 5. Safety is equal to Symbol: SELECT * FROM employees WHERE commission_pct <=> NULL; This is the end of this article about the necessary conditional query statements for MySQL database. For more relevant MySQL conditional query content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of the use of title tags and paragraph tags in XHTML
>>: How to make a website front end elegant and attractive to users
Vue components are connected, so it is inevitable...
1. Basic Specifications (1) InnoDB storage engine...
Several common paging methods: 1. Escalator metho...
Table of contents Tutorial Series 1. Install Mari...
reason The mysql version that nacos's pom dep...
1. Custom text selection ::selection { background...
This article example shares the specific code of ...
Two-column layout is often used in projects. Ther...
How to delete environment variables in Linux? Use...
Difference between HTML and XHTML 1. XHTML elemen...
MySQL 5.7.9 version sql_mode=only_full_group_by i...
Table of contents 1. What is syntactic sugar? 2. ...
introduce RANGE partitioning is based on a given ...
This article shares the specific code of jQuery t...
In centos7, the permissions of the /etc/rc.d/rc.l...