当前位置:网站首页>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
边栏推荐
- Reading notes series "modern methods of C language programming" -- Chapter 2
- Li Kou daily question - Day 32 -1232 Dotted line
- Leetcode-141 circular linked list
- 力扣每日一题-第32天-1232. 缀点成线
- 华为云专家详解GaussDB(for MySQL)新特性
- 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
- After studying 11 kinds of real-time chat software, I found that they all have these functions
- A wonderful time to buy and sell stocks
- Blue Bridge Cup real topic: the shortest circuit
- Why do independent website sellers start to do social media marketing? The original customer conversion rate can be improved so much!
猜你喜欢

Lumiprobe bifunctional crosslinker sulfo cyanine 5 bis NHS ester

1380. Lucky number in matrix / 1672 Total assets of the richest customers

6款红黄黑榜摄像头评测:谁最安全?谁画质好?从此让你不再踩雷

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

Lumiprobe non fluorescent alkyne EU (5-ethynyluridine)

Memo - about C # generating barcode

Privacy sandbox is finally coming

C# SelfHost WebAPI (2)

GAMES202作业0-环境搭建过程&解决遇到的问题

Operation of cmake under win
随机推荐
Calculation of intersection of two line segments
Computer network interview assault
Implementation of converting PCM file to WAV
Weekly recommended short videos: be alert to the confusion between "phenomena" and "problems"
用WPF写一款开源方便、快捷的数据库文档查询、生成工具
R language ggplot2 visualization: gganimate creates a dynamic histogram animation (GIF), and displays the histogram and enter step by step along a given dimension in the animation_ Growth function and
Leetcode-141 circular linked list
Technology implementation and Architecture Practice
如何运营好技术相关的自媒体?
Navicat Premium 15 永久破解和2021版本最新IDEA破解(亲测有效)
Popular science: what does it mean to enter the kernel state?
《Go题库·16》读写锁底层是怎么实现的
1380. Lucky number in matrix / 1672 Total assets of the richest customers
LeetCode-21合并两个有序链表
宏观视角看抖音全生态
Leetcode-83 删除排序链表中重复的元素
如何在自有APP内实现小程序实现连麦直播
Leetcode-160 intersecting linked list
Three. JS learning - basic operation of camera (learn from)
Lumiprobe 双功能交联剂丨Sulfo-Cyanine5 双-NHS 酯