当前位置:网站首页>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 种简单的查询方法。
边栏推荐
- C#使用WinExec调用exe程序
- Common usage of LINQ in C #
- 這個開源項目超哇塞,手寫照片在線生成
- WinForm uses zxing to generate QR code
- Learn spark computing framework in practice (01)
- October 17, 2020: question brushing 1
- Analysis on the specific execution process of an insert statement in MySQL 8.0 (2)
- Contents of advanced mathematics
- 在实践中学习Spark计算框架(00)
- QGIS mapping
猜你喜欢
随机推荐
std::make_ shared<T>/std::make_ Unique < T> and std:: shared_ ptr<T>/std::unique_ The difference and relation between PTR < t >
Graphics learned from jigsaw puzzles h
Use of Azkaban in task scheduler
BUUCTF--reverse2
Implementation of iequalitycomparer interface in C #
给定两个整形变量的值,将两个值的内容进行交换 (C语言)
C语言库函数--strstr()
完全二叉树的权值 递归做法 ——最后的编程挑战
区域工业互联网市场成绩单,百度智能云开物第二
BUUCTF--内涵的软件
Dynamic planning summary
September 29, 2020 non commodity templating code level rapidjson Library
Picture verification code control
Arc view and arc viewpager
This open source project is super wow, and handwritten photos are generated Online
MySQL中update一条record的过程
解决zxing的QR码包含中文时乱码的问题
Voir le classement des blogs pour csdn
IIS服务器相关错误
Six dimensional space BFS









