当前位置:网站首页>DQL where query
DQL where query
2022-07-21 13:57:00 【Camellia——】
-- where Conditional query
-- basic where Statement query
-- Operation symbol
-- <,>,<=,>=,=
-- Parallel relationship &&,and
-- between Conditions 1 and Conditions 2
-- Or the relationship between || ,or
-- in( aggregate )
-- is null: A field is empty Or not empty is not null
SELECT * FROM student;-- demand : Inquire about student Table middle school students are older than 20 A man of years old
SELECT
NAME,
age
FROM
student
WHERE age > 20 ;-- demand : Inquire about student The age in the table is less than or equal to 20 year
SELECT
NAME,
age
FROM
student
WHERE age <= 20 ;-- Format 2:
SELECT
NAME,
age
FROM
student
WHERE age < 20
OR age = 20 ;-- ||(Java Logical symbols in ), Recommended or
SELECT * FROM student; -- Display full table data-- demand : The age of inquiry is 20~30 People between the ages of ( Include both ends )
-- Format 1:
SELECT
NAME,
age
FROM
student
WHERE age >= 20 && age <= 30 ;-- Format 2:
SELECT
NAME,
age
FROM
student
WHERE age >= 20
AND age <= 30 ;
-- between Conditions 1 and Conditions 2; Query between that range
SELECT
NAME,
age
FROM
student
WHERE age BETWEEN 20
AND 30 ;-- demand : The age in the student table is not 20 A man of years old
SELECT
NAME,
age
FROM
student
WHERE age != 20 ; -- !=(java Middle operator )SELECT
NAME,
age
FROM
student
WHERE age <> 20 ;-- mysql:<>: It's not equal toSELECT * FROM student;
-- need : The English score is null Student information (name)
SELECT
NAME
FROM
student
WHERE english IS NULL ;-- A field is null: Field name is null-- The English score is not null Student information
SELECT
NAME
FROM
student
WHERE english IS NOT NULL ;-- demand : Age is 18,28,30 The name of the year old student
SELECT
NAME
FROM
student
WHERE age = 18
OR age = 28
OR age = 30 ;
-- Optimize the above format in( Aggregate data )
SELECT
`name`,
math,
english
FROM
student
WHERE age IN (18, 28, 30) ;
边栏推荐
- How to use DTS data subscription to obtain incremental data of DTS cache module?
- 重链剖分链加与极值
- DQL语句_查询表中指定的字段_以及指定的别名_以及字段去重
- TF coordinate transformation
- 7.5 binary search (sort) tree
- 【WebFace260M】《WebFace260M:A Benchmark Unveiling the Power of Million-Scale Deep Face Recognition》
- Operation and maintenance experience sharing of stolen mailbox disposal in Colleges and Universities - Tsinghua University
- C# 同步 异步 回调 状态机 async await Demo
- 如何实现随叫随到的客户服务
- 架构训练营模块七作业
猜你喜欢
【WMCA】《Biometric Face Presentation Attack Detection with Multi-Channel Convolutional Neural Network》
Set shell script to start automatically
Operation and maintenance experience sharing of stolen mailbox disposal in Colleges and Universities - Tsinghua University
Starfish OS: create a new paradigm of the meta universe with reality as the link
5 种常见的 async/await 误用
话实践,行实干,成实事:“巡礼”数字化的中国大地
不懂 CAN ?一文告诉你CAN协议!
7.6 balanced binary tree (AVL tree)
LeetCode刷题--点滴记录018
【WebFace260M】《WebFace260M:A Benchmark Unveiling the Power of Million-Scale Deep Face Recognition》
随机推荐
【安装PG】
一种简单方法--确定字典是否发生变化
1. Rip experiment demonstration (Huawei router device configuration)
C#中缓存的使用
How can we make enterprise knowledge management play its real value?
ES6基本了解
【WebFace260M】《WebFace260M:A Benchmark Unveiling the Power of Million-Scale Deep Face Recognition》
【WebFace260M】《WebFace260M:A Benchmark Unveiling the Power of Million-Scale Deep Face Recognition》
经典重温:理解神经网络的“知识一致性”(ICLR 2020)
QT compile the Internet of things management platform 45- collect data and forward
如何搭建一个知识库网页?
【JZOF】05替换空格
What are the main aspects of troubleshooting when DTS write module delays writing to the target database?
浙江的哪个银行网点可以买到ETF基金产品?
CAD给实体设置超链接(网页版)
直播系统源码,登录时自动填取获得的验证码
2022 mathematical modeling "May Day Cup" B problem solution + paper
How can the clothing industry make the real economy smart?
ThreadLocal parent-child thread delivery problem -- familiar with Ali's transmittablethreadlocal
IO输入输出流