当前位置:网站首页>Oracle advanced SQL qualified query
Oracle advanced SQL qualified query
2022-06-24 07:53:00 【Mr. Li, a prodigy】
One must keep writing , In order not to be submerged by the vast sea of people
Articles are constantly updated , You can search by wechat 【 Xiaoqi JAVA interview 】 First time reading , reply 【 Information 】 Access to benefits , reply 【 project 】 Get the source code of the project , reply 【 The resume template 】 Get resume template , reply 【 Learning Roadmap 】 Get a learning roadmap .

List of articles
- One 、 Relational operator
- Two 、 Logical operators
- 3、 ... and 、 Range operation
- Four 、 Empty judgment
- 5、 ... and 、IN The operator
- 6、 ... and 、 Fuzzy query
- 7、 ... and 、 Query sequence
- 1、 Query all students , And in order of age
- 2、 Query all students , And in order of age
- 3、 Query all students , And in order of age , If they are of the same age, they will be sorted according to the student number from small to large
- 4、 Query all students , And in order of age , If they are of the same age, they will be sorted according to the student number
- 8、 ... and 、 summary
Relationship between operation :>、=、<、>=、<=、!=、<>
Range operation :between…and
Empty judgment :is null、is not null
IN Judge :in、not in
Fuzzy query :like、not like
Logical operations :and( And )、or( or )、not( Not )
One 、 Relational operator
1、 Query age is less than 20 Of the students
select * from student where age < 20;
2、 Check all male students
select * from student where sex=' male ';
3、 Query all students who are not male students
Either of the following is OK
select * from student where sex != ' male ';
select * from student where sex <> ' male ';
Two 、 Logical operators
and、or
1、 Query is not male but younger than 20 Classmate
select * from student where sex != ' male ' and age < 20;
2、 The query is a female classmate or older than 20 Classmate
select * from student where sex = ' Woman ' or age > 20;
3、 The query age is less than 20 Classmate
Either of the following is OK
select * from student where age < 20;
select * from student where age not >= 20;
3、 ... and 、 Range operation
1、 The age of inquiry is 10 To the age of 20 Students aged between
Either of the following is OK , however between Is an operator , The other is a relational operator >= Add a logical operator and, therefore between It's more efficient .
select * from student where age between 10 and 20;
select * from student where age >= 10 and age <= 20;
2、 The query in 1998 year 9 Students born in September
select * from student where birthday between '01-9 month -98' and '30-9 month -1998';
Four 、 Empty judgment
1、 Query students whose names are not empty
select * from student where name is not null;
5、 ... and 、IN The operator
1、 Look up the students whose names are Zhang San and Li Si
select * from student where name in (' Zhang San ',' Li Si ');
2、 Query the students whose names are Zhang Sanhe and Kong
select * from student where name in (' Zhang San ',null);
3、 Query the students whose names are not Zhang Sanhe
select * from student where name not in (' Zhang San ',null);
Here we need to pay attention to , When not in There is null when , No results can be found from the query .
6、 ... and 、 Fuzzy query
“_”: Match any one of the symbols .
“%”: Match any symbol , It can be 0、1、2、 Multiple symbols .
1、 Inquire about the classmate surnamed Li
select * from student where name like ' Li %';
2、 Inquire about the classmate surnamed Li , And the name has only two words
select * from student where name like ' Li _';
3、 The query name contains “ handsome ” My classmate
select * from student where name like '% handsome %';
7、 ... and 、 Query sequence
order by [ Sort rule ]
Default and asc Positive sort
desc It's in reverse order
1、 Query all students , And in order of age
select * from student order by age;
2、 Query all students , And in order of age
select * from student order by age desc;
3、 Query all students , And in order of age , If they are of the same age, they will be sorted according to the student number from small to large
select * from student order by age desc,sno;
4、 Query all students , And in order of age , If they are of the same age, they will be sorted according to the student number
select * from student order by age desc,sno desc;
8、 ... and 、 summary
The relevant contents here have not been sorted out yet , The article continues to be updated later , Recommended collection .
The commands involved in the article must be typed several times each like me , Only in the process of knocking can you find out whether you really master the command .
You can search by wechat 【 Xiaoqi JAVA interview 】 First time reading , reply 【 Information 】 Access to benefits , reply 【 project 】 Get the source code of the project , reply 【 The resume template 】 Get resume template , reply 【 Learning Roadmap 】 Get a learning roadmap .
边栏推荐
- Moonwell Artemis现已上线Moonbeam Network
- What industries and scenarios can the easynvr/easygbs/easycvr platform developed by tsingsee green rhino video be used in?
- Detailed explanation of PHP data serialization test example
- C code writing specification
- 【008】表格数据逐行筛选,跳出for循环及跳过本次循环思路_#VBA
- Standing at the center of the storm: how to change the engine of Tencent
- Thread considerations
- timer使用备注
- What is the lifecycle of automated testing?
- How to cancel the display of the return button at the uniapp uni app H5 end the autobackbutton does not take effect
猜你喜欢

AWTK 最新动态:Grid 控件新用法

第 2 篇:繪制一個窗口

【008】表格数据逐行筛选,跳出for循环及跳过本次循环思路_#VBA

Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its

用Ngrok 配置属于自己的免费外网域名

【资料上新】迅为基于3568开发板的NPU开发资料全面升级

基于Distiller的模型压缩工具简介

ImportError: cannot import name ‘process_pdf‘ from ‘pdfminer.pdfinterp‘错误完全解决

Baidu map, coordinate inversion, picking coordinate position

Moonwell Artemis is now online moonbeam network
随机推荐
用Ngrok 配置属于自己的免费外网域名
What challenges does the video streaming media platform face in transmitting HD video?
These dependencies were not found: * core JS / modules / es6 array. Fill in XXX
屏幕截图推荐—Snipaste
单片机STM32F103RB,BLDC直流电机控制器设计,原理图、源码和电路方案
uniapp uni-app H5 端如何取消 返回按钮的显示 autoBackButton不生效
1-4metasploitable2介绍
Detailed explanation of PHP data serialization test example
云开发谁是卧底小程序源码
C code writing specification
线程注意事项
自动化测试的生命周期是什么?
Unity 的序列化
《canvas》之第1章 canvas概述
redolog和binlog
Common array encapsulation
The two most frequently asked locks in the interview
Bit operation
3-列表简介
运行npm run eject报错解决方法