当前位置:网站首页>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
边栏推荐
- Basic knowledge and commands of disk
- Li Kou daily question - Day 32 -1232 Dotted line
- Using OpenSSL encryption to rebound shell traffic
- Is Alipay wallet convenient to use?
- Five degrees easy chain enterprise app is newly upgraded
- R language uses the transmute function of dplyr package to calculate the moving window mean value of the specified data column in dataframe data, and uses ggplot2 package to visualize the line graph b
- R language uses the aggregate function of epidisplay package to divide numerical variables into different subsets based on factor variables, and calculate the summary statistics of each subset
- LeetCode-21合并两个有序链表
- Blue Bridge Cup real question: score statistics
- Reading notes series "modern methods of C language programming" -- Chapter 2
猜你喜欢

After studying 11 kinds of real-time chat software, I found that they all have these functions

Leetcode-141环形链表

1、《创建您自己的NFT集合并发布一个Web3应用程序来展示它们》什么是NFT

关于企业中台规划和 IT 架构微服务转型

Leetcode-21 combines two ordered linked lists

Leetcode-83 删除排序链表中重复的元素

Halcon图片标定,使得后续图片处理过后变成与模板图片一样

创建您自己的NFT集合并发布一个Web3应用程序来展示它们(介绍)

主成分之综合竞争力案例分析

Solution: you can ping others, but others can't ping me
随机推荐
LiveData postValue会“丢”数据
力扣每日一题-第32天-589.N×树的前序遍历
C operator overloads the query table
用GSConv+Slim Neck改进Yolov5,将性能提升到极致!
Basic concepts of binary tree
[image denoising] matlab code for removing salt and pepper noise based on fast and effective multistage selective convolution filter
Implementation of converting PCM file to WAV
R language uses the DOTPLOT function of epidisplay package to visualize the frequency of data points in different intervals in the form of point graph, and uses PCH parameters to customize the shape o
AI 训练速度突破摩尔定律;宋舒然团队获得RSS 2022最佳论文奖
搭建一个通用监控告警平台,架构上需要有哪些设计
Halcon图片标定,使得后续图片处理过后变成与模板图片一样
Search 2D matrix 2
Case study on comprehensive competitiveness of principal components
Is Alipay wallet convenient to use?
Must see, time series analysis
Principal component calculation weight
About enterprise middle office planning and it architecture microservice transformation
Leetcode-83 删除排序链表中重复的元素
Blue Bridge Cup real problem: word analysis
Sum of three numbers