当前位置:网站首页>SQL Server 数据库的几种简单查询
SQL Server 数据库的几种简单查询
2022-06-29 09:28:00 【小哥丷】
在数库文件内容较多的情况下,为了更加明确快速得找到某条信息,下面举出3种SQL查询方法:
1、投影查询
2、选择查询
3、排序查询
下面给出的是进行测试的数据库表Table:

首先是投影查询,为了让查看的数据更加明确,易懂。
投影查询有三种写法:
① select CID 客户编号,CContact 联系人,CPhone 联系电话,CIntegration 积分 from Table
② select CID AS客户编号,CContact AS联系人,CPhone AS联系电话,CIntegration AS积分 from Table
③ select 客户编号=CID,联系人=CContact,联系电话=CPhone,积分=CIntegration from Table
投影查询结果:

其次是选择查询,为了准确的查到条件所在的数据内容。
select * from Table where CIntegration<=24 and CPhone like '%244575%'
%表示任意长度的字符串
选择查询积分小于24并且电话为244575的数据结果:

最后是排序查询,升序和降序排列 。
select * from Table order by CIntegration desc
desc:降序,asc:升序,默认是升序
排序查询结果:

这就是SQL Server 数据库的 3 种简单的查询方法。
边栏推荐
- The process of updating a record in MySQL
- BUUCTF--新年快乐
- 2019.10.20 training summary
- Downloading and installing VMware (basic idea + detailed process)
- Reading notes of CLR via C -clr boarding and AppDomain
- WinForm uses zxing to generate QR code
- C语言库函数--strstr()
- I would like to know how to open an account for free online stock registration? In addition, is it safe to open a mobile account?
- 2020-9-14 introduction to advertising system
- Related problems of pointer array, array pointer and parameter passing
猜你喜欢

Common usage of LINQ in C #

2020-10-17:刷题1

2021 team programming ladder competition - Simulation Competition

Comment terminer rapidement une partition de disque

Solve the problem that zxing's QR code contains Chinese garbled code

Recurrence of vulnerability analysis for Cisco ASA, FTD and hyperflex HX

Linux下Redis安装及集群搭建

Beautiful ruins around Kiev -- a safe guide to Chernobyl!

《CLR via C#》读书笔记-加载与AppDomain

Seaweedfs security configuration
随机推荐
CLR via C reading notes - loading and AppDomain
std::make_shared<T>/std::make_unique<T>与std::shared_ptr<T>/std::unique_ptr<T>的区别与联系
MySQL中innodb_page_cleaners详解
Analyze in detail the PBOT mining virus family behavior and the principle of exploited vulnerabilities, and provide detailed protection suggestions for the blue army
1098 insertion or heap sort (25 points)
Recyclerview universal adapter package
I would like to know how to open an account for free online stock registration? In addition, is it safe to open a mobile account?
Dev使用过程中的基本操作
Win32Exception (0x80004005): 组策略阻止了这个程序。要获取详细信息,请与系统管理员联系。
std::unique_ PTR < T> and boost:: scoped_ Particularity of PTR < t >
L2-3 is this a binary search tree- The explanation is wonderful
QGIS mapping
2020-10-17:刷题1
520 diamond Championship 2021
【高等数学】目录
2019.11.3 learning summary
這個開源項目超哇塞,手寫照片在線生成
Contents of advanced mathematics
qgis制图
2020-09-21 visual studio header file and Library Directory configuration