博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sql limit子句_SQL子句解释的位置:之间,之间,类似和其他示例
阅读量:2520 次
发布时间:2019-05-11

本文共 2941 字,大约阅读时间需要 9 分钟。

sql limit子句

什么是SQL Where子句? (What is a SQL Where Clause?)

WHERE子句(和/或INBETWEENLIKE ) (The WHERE  Clause (and/or,  IN ,  BETWEEN , and  LIKE ))

The  WHERE  clause is used to limit the number of rows returned.

WHERE子句用于限制返回的行数。

In this case all five of these will be used is a some what ridiculous  WHERE  clause.

在这种情况下,将使用所有这五个荒谬的WHERE子句。

Here is the current full student list to compare to the  WHERE  clause result set:

这是当前的完整学生列表,可与WHERE子句结果集进行比较:

select studentID, FullName, sat_score, rcd_updated from student;
+-----------+------------------------+-----------+---------------------+| studentID | FullName               | sat_score | rcd_updated         |+-----------+------------------------+-----------+---------------------+|         1 | Monique Davis          |       400 | 2017-08-16 15:34:50 ||         2 | Teri Gutierrez         |       800 | 2017-08-16 15:34:50 ||         3 | Spencer Pautier        |      1000 | 2017-08-16 15:34:50 ||         4 | Louis Ramsey           |      1200 | 2017-08-16 15:34:50 ||         5 | Alvin Greene           |      1200 | 2017-08-16 15:34:50 ||         6 | Sophie Freeman         |      1200 | 2017-08-16 15:34:50 ||         7 | Edgar Frank "Ted" Codd |      2400 | 2017-08-16 15:35:33 ||         8 | Donald D. Chamberlin   |      2400 | 2017-08-16 15:35:33 ||         9 | Raymond F. Boyce       |      2400 | 2017-08-16 15:35:33 |+-----------+------------------------+-----------+---------------------+9 rows in set (0.00 sec)

Rows will be presented that…

将显示以下行:

  • WHERE  Student IDs are between 1 and 5 (inclusive)

    WHERE学生ID是1和5(含)之间

  • OR  studentID = 8

    OR学生ID = 8

Here’s an updated query, where any record that has an SAT score that’s in this list (1000, 1400) will not be presented:

这是一个更新的查询,其中不会显示此列表中(1000,1400)具有SAT分数的任何记录:

select  studentID, FullName, sat_score, recordUpdatedfrom    studentwhere   (studentID between 1 and 5 or studentID = 8)        and        sat_score NOT in (1000, 1400);
+-----------+----------------------+-----------+---------------------+| studentID | FullName             | sat_score | rcd_updated         |+-----------+----------------------+-----------+---------------------+|         1 | Monique Davis        |       400 | 2017-08-16 15:34:50 ||         2 | Teri Gutierrez       |       800 | 2017-08-16 15:34:50 ||         4 | Louis Ramsey         |      1200 | 2017-08-16 15:34:50 ||         5 | Alvin Greene         |      1200 | 2017-08-16 15:34:50 ||         8 | Donald D. Chamberlin |      2400 | 2017-08-16 15:35:33 |+-----------+----------------------+-----------+---------------------+5 rows in set (0.00 sec)

*As with all of these SQL things there is MUCH MORE to them than what’s in this introductory guide.

*与所有这些SQL事物一样,它们比本入门指南中的内容要多得多。

I hope this at least gives you enough to get started.

我希望这至少能给您足够的入门。

Please see the manual for your database manager and have fun trying different options yourself.

请参阅数据库管理员的手册,并尝试自己尝试其他选项,这很有趣。

翻译自:

sql limit子句

转载地址:http://bqrwd.baihongyu.com/

你可能感兴趣的文章
设计模式 - 简单工厂
查看>>
数组与指针杂记
查看>>
四色原理
查看>>
Codeforces Round#500 Div.2 翻车记
查看>>
再更新ww的mingw MinGW-full-20101119
查看>>
Benefit UVA - 11889
查看>>
全排列 最详细的解题报告
查看>>
c++ web服务器
查看>>
android机型排行榜(201509)
查看>>
eclipse + maven + scala+spark环境搭建
查看>>
jmeter中webdriver插件,进行自动化压测
查看>>
整站开发初始化
查看>>
洛谷P2900 [USACO08MAR]土地征用Land Acquisition(斜率优化)
查看>>
uoj#448. 【集训队作业2018】人类的本质(Min_25筛+拉格朗日插值)
查看>>
vim配置及插件安装管理(超级详细)
查看>>
楼市仅是阶段性回暖 去库存仍是明年楼市主基调
查看>>
UIImagePickerController
查看>>
怎样打开64位 Ubuntu 的32位支持功能?
查看>>
关于docker jenkins启动时失败的问题处理
查看>>
JavaScript 循环绑定之变量污染
查看>>