当前位置:网站首页>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
边栏推荐
- golang 错误处理
- 2、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》启动并运行您的本地环境
- Introduction to easyclick database
- 如何在自有APP内实现小程序实现连麦直播
- Write an open source, convenient and fast database document query and generation tool with WPF
- Lumiprobe biomolecular quantification - qudye Protein Quantification Kit
- 3、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》在本地铸造 NFT
- R语言ggplot2可视化:gganimate创建动态柱状图动画(gif)、在动画中沿给定维度逐步显示柱状图、enter_grow函数和enter_fade函数控制运动内插退出(渐变tweening)
- Thread forced join, thread forced join application scenarios
- LiveData postValue会“丢”数据
猜你喜欢
实例讲解将Graph Explorer搬上JupyterLab
Lumiprobe 生物分子定量丨QuDye 蛋白定量试剂盒
Blue Bridge Cup real topic: the shortest circuit
Lumiprobe 双功能交联剂丨Sulfo-Cyanine5 双-NHS 酯
Search 2D matrix 2
Privacy sandbox is finally coming
每周推薦短視頻:警惕“現象”與“問題”相互混淆
Must see, time series analysis
Operation of cmake under win
Mise en place d'une plate - forme générale de surveillance et d'alarme, quelles sont les conceptions nécessaires dans l'architecture?
随机推荐
Privacy sandbox is finally coming
实现一个Prometheus exporter
C language learning notes: type definition typedef and declaration external CSDN creation punch in
搭建一個通用監控告警平臺,架構上需要有哪些設計
The R language uses the tablestack function of epidisplay package to make statistical summary tables (descriptive statistics based on the grouping of target variables, hypothesis testing, etc.). If th
如何运营好技术相关的自媒体?
Evaluation of 6 red, yellow and black list cameras: who is the safest? Who has good picture quality? From now on, let you no longer step on thunder
GameFramework食用指南
12 data dimensioning processing methods
A wonderful time to buy and sell stocks
R语言epiDisplay包ordinal.or.display函数获取有序logistic回归模型的汇总统计信息(变量对应的优势比及其置信区间、以及假设检验的p值)、write.csv函数保存csv
[today in history] February 15: Pascal's father was born; YouTube was founded; Kotlin language comes out
Search 2D matrix 2
R语言caTools包进行数据划分、scale函数进行数据缩放、class包的knn函数构建K近邻分类器、table函数计算混淆矩阵
NSI packaging script add file details
为什么独立站卖家都开始做社交媒体营销?原来客户转化率能提高这么多!
Three. JS learning - basic operation of camera (learn from)
Force buckle day33
3、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》在本地铸造 NFT
Halcon image calibration enables subsequent image processing to become the same as the template image