当前位置:网站首页>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 种简单的查询方法。
边栏推荐
- 攻防世界-Re-insfsay
- September 25, 2020 noncopyable of boost library for singleton mode
- Application of Pgp in encryption technology
- Slide the custom control to close the activity control
- L2-031 go deep into the tiger's den (25 points)
- Win32Exception (0x80004005): 组策略阻止了这个程序。要获取详细信息,请与系统管理员联系。
- Linux下Redis安装及集群搭建
- 【高等数学】目录
- manacher
- 打印100~200之间的素数(C语言)
猜你喜欢

Installing and configuring wmware esxi 6.5.0 in VMware Workstation

Reading notes of CLR via C -clr boarding and AppDomain

Attribute in C

2020-10-17:刷题1

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

Downloading and installing VMware (basic idea + detailed process)

通过Win32API调用另一界面的按钮

This open source project is super wow, and handwritten photos are generated Online

六度空间 bfs

AQS之Atomic详解
随机推荐
2019.10.20 training summary
1099 build a binary search tree (30 points)
September 25, 2020 noncopyable of boost library for singleton mode
2019.10.27 training summary
Implementation of iequalitycomparer interface in C #
520 diamond Championship 2021
1146 topological order (25 points)
std::make_ shared<T>/std::make_ Unique < T> and std:: shared_ ptr<T>/std::unique_ The difference and relation between PTR < t >
2019.10.30 learning summary
Oracle reset sequence generator (non rebuild)
指针数组、数组指针和传参的相关问题
BUUCTF--新年快乐
1021 deep root (25 points)
Devaxpress double click to get cell data
Use of Azkaban in task scheduler
《CLR via C#》读书笔记-单实例应用程序
Comment terminer rapidement une partition de disque
C#中Linq常用用法
给定两个整形变量的值,将两个值的内容进行交换 (C语言)
Learn spark computing framework in practice (01)