当前位置:网站首页>Database foundation: select basic query statement
Database foundation: select basic query statement
2022-07-01 18:48:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
data The basic query statement specification of the library is :select Area from Table name
Query the specified table
select * from Table name
*: Represents all columns
Example :select * from TL_REQUEST
Query specified column
select Name from Table name
Name : Represents to search from the specified column name
,: If it is to find the corresponding multiple columns , Then use English commas to separate
Example : select BU_NO from TL_REQUEST select BU_NO,BU_NM from TL_REQUEST
Conditions of the query
select * from Table name where Conditions
*: Represents all columns
Conditions : It's usually where Conditional expression
The query column contains numbers or letters :select * from Table name where Name =’ value ’
Example : select * from TL_REQUEST where BU_NO=’1234′ select * from TL_REQUEST where BU_NM=’ Xiaofang ’
Range queries
select * from Table name where Name between ‘A’ and ‘B’
or
select * from Table name where Name >=’A’ and Name <=’B’
Example : select*from TL_REQUEST where BU_NO between ‘1000’ and ‘1234’ select*from TL_REQUEST where BU_NO>=’1000′ and BU_NO<=’1234′
Multiconditional query
Or conditional query :or
select * from Table name where Name =’A’ or Name =’B’
Example :select * from TL_REQUEST where BU_NO=’1000′ or BU_NO=’1234′
And condition query :and
select * from Table name where Name =’A’and Name =’B’
Example :select * from TL_REQUEST where BU_NO=’1000′ and CONTRACT_NO=’tl001′
Discrete queries
Include value query :in()
select * from Table name where Name =’A’ Name =’B’ Name =’C’
or :
select * from Table name where Name in(‘A’,’B’,’C’)
Example : select * from TL_REQUEST where BU_NO=’1000′ BU_NO=’1234′ BU_NO=’1311′ or : select * from TL_REQUEST where BU_NO in(‘1000′,’1234′,’1311’)
Query without value :not in()
select * from Table name where Name not in(‘A’,’B’,’C’)
Example :select * from TL_REQUEST where BU_NO not in(‘1000′,’1234′,’1311’)
Fuzzy query
The query column contains specific Chinese :select * from Table name where Name like ‘% chinese %’
Like: Add... Before the name .
%: Any number of characters .
_: The underscore indicates any character .
Example :select * from TL_REQUEST where BU_NM like ‘% ladyfy %’ Or query the situation where the second character is Fang select * from TL_REQUEST where BU_NM like ‘%_ Fragrant %’
Go to check again
select distinct Name from Table name
Example :select distinct BU_NO from TL_REQUEST
Combination query
select distinct Name from Table name where Conditions
Example :select distinct BU_NO from TL_REQUEST where BU_NO between ‘1000’ and ‘1234’
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/130835.html Link to the original text :https://javaforall.cn
边栏推荐
- 实现一个Prometheus exporter
- docker 部署mysql8.0
- Computer network interview assault
- 隐私沙盒终于要来了
- Leetcode-141环形链表
- Blue Bridge Cup real topic: the shortest circuit
- R language epidisplay package ordinal or. The display function obtains the summary statistical information of the ordered logistic regression model (the odds ratio and its confidence interval correspo
- R语言使用epiDisplay包的dotplot函数通过点图的形式可视化不同区间数据点的频率、使用pch参数自定义指定点图数据点的形状
- [source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
- Leetcode203 remove linked list elements
猜你喜欢
每周推薦短視頻:警惕“現象”與“問題”相互混淆
What designs are needed in the architecture to build a general monitoring and alarm platform
实例讲解将Graph Explorer搬上JupyterLab
斯坦福、Salesforce|MaskViT:蒙面视觉预训练用于视频预测
创建您自己的NFT集合并发布一个Web3应用程序来展示它们(介绍)
Three.js学习-相机Camera的基本操作(了解向)
[today in history] February 15: Pascal's father was born; YouTube was founded; Kotlin language comes out
因子分析怎么计算权重?
Force buckle day33
Lumiprobe bifunctional crosslinker sulfo cyanine 5 bis NHS ester
随机推荐
About enterprise middle office planning and it architecture microservice transformation
2020,最新手机号码手机验证正则表达式,持续更新
Regular expression
Leetcode-21 combines two ordered linked lists
实例讲解将Graph Explorer搬上JupyterLab
Mise en place d'une plate - forme générale de surveillance et d'alarme, quelles sont les conceptions nécessaires dans l'architecture?
用GSConv+Slim Neck改进Yolov5,将性能提升到极致!
Relational database management system of easyclick
Introduction to easyclick database
Must see, time series analysis
用WPF写一款开源方便、快捷的数据库文档查询、生成工具
斯坦福、Salesforce|MaskViT:蒙面视觉预训练用于视频预测
Mysql database of easyclick
研究了11种实时聊天软件,我发现都具备这些功能…
Privacy sandbox is finally coming
Thread forced join, thread forced join application scenarios
R语言使用epiDisplay包的tableStack函数制作统计汇总表格(基于目标变量分组的描述性统计、假设检验等)、不设置by参数则计算数据框指定数据列范围的基础描述性统计信息
C operator overloads the query table
如何运营好技术相关的自媒体?
12 data dimensioning processing methods