当前位置:网站首页>SQL basic statement DQL select and extract DML insert delete
SQL basic statement DQL select and extract DML insert delete
2022-07-25 22:10:00 【Not ashamed_】
SQL Sentences can be roughly divided into four categories :
1) DDL: Data definition language , establish 、 Delete 、 modify the database 、 Data table .
2) DML: Data management language , Add the data in the data table 、 Delete 、 Modify the operating .
3) DQL: Data query language , Query the data in the data table .
4) DCL: Data control language , Permissions on the database 、 Role, etc .
Here first write DQL sentence
Simple query
The simplest select
select Field list from Table name
Field and table rename
select Field name as Alias , Field name as Alias from Table name as Alias
where
Filter query records . Only records that meet the screening criteria , Will appear in the query results .
1) Comparison operator
Operator effect
“>” Greater than
“>=” Greater than or equal to
"<" Less than
“<=” Less than or equal to
“=” be equal to
“!=,<>” It's not equal to
null Value does not participate in the comparison operation
2) Logical operators
Operator effect
and Logic and
or Logic or
not Logic is not
3) Null Value judgment
Operator effect
is null Field is null
is not null Field is not null
4) between…and…
Range of judgment , Closed interval .
amount to Field >= value and Field <= value .
5) Fuzzy query
Field like ' The rules '
The rules : % Represents any number of arbitrary characters ,_ Represents any character .
SQL Case insensitive ,like,= They're all case insensitive .
6) in
Field in ( value , value , value ...)
Field not in ( value , value , value ...)
Group query
Use group by In the queried data , Grouping , Records with the same specified fields will be merged into a group .
group by Field name , ...
group by 1, 2, ... // The subscript of the field , from 1 Start
边栏推荐
- Unity performance optimization direction
- 文件无法保存(文件夹已损坏无法读取怎么办)
- Bitcoin.com:usdd represents a truly decentralized stable currency
- Sofa weekly | open source person - Niu Xuewei, QA this week, contributor this week
- Redis是什么?简述它的优缺点
- internship:普通常用的工具类编写
- How to implement an app application to limit users' time use?
- Playwright tutorial (I) suitable for Xiaobai
- Summary of function test points of wechat sending circle of friends on mobile terminal
- C语言:随机生成数+冒泡排序
猜你喜欢
随机推荐
ansible+Crontab批部署巡检
synchronized与volatile
五种分配方式是否会产生内部碎片、外部碎片
MySQL - subquery - column subquery (multi row subquery)
What are the application characteristics of NTU general database gbase Bi?
Children's programming electronic society graphical programming level examination scratch level 1 real problem analysis (judgment question) June 2022
The automation testing post spent 20K recruiting, but in the end, there was no suitable one. Both fresh students are better than them
The file cannot be saved (what if the folder is damaged and cannot be read)
测试工作不受重视,你换位思考了吗?
『SignalR』. Net using signalr for real-time communication
3day
Playwright tutorial (II) suitable for Xiaobai
The reisson distributed lock renewal failed due to network reasons, resulting in the automatic release of the lock when the business is still executing but the lock is not renewed.
C语言游戏 双缓存解决闪屏问题 详细总结[通俗易懂]
Virtual memory and disk
Bitcoin.com:usdd represents a truly decentralized stable currency
C language left value and right value description [easy to understand]
Uninstall NPM and install NPM_ Use 'NPM uninstall' to uninstall the NPM package 'recommended collection'
zigbee开发板(nxpzigbee开发)
关于接口测试你想知道的都在这儿了









