首页 > 数据库 > SQL Server > 正文
SQL查询初学者指南读书笔记(二)创建SQL查询
2015-06-03       个评论    来源:soliddream66的专栏  
收藏    我要投稿

PARTII: SQL Basics

CHAPTER 4Creating a Simple Query


介绍一种如何创建SQL语句的技术--“Request/Translation/Clean Up/SQL”

The SELECT operationin SQL can be broken down into three smaller operations,

which we will referto as the SELECT statement,the SELECT expression,

and the SELECTquery.

一层包含一层,相互嵌套使用,可以构成非常复杂的SELECT.


SELECT Statement的其它关键词都比较熟悉,这儿稍微解释GROUP BY和HAVING

GROUP BY—When youuse aggregate functions in the SELECT clause

to produce summaryinformation, you use the GROUP BY clause to

divide theinformation into distinct groups.Your database system uses

any column or listof columns following the GROUP BY keywords as

grouping columns.The GROUP BY clause is optional, and we’ll examine

it further inChapter 13, Grouping Data.

HAVING—The HAVINGclause filters the result of aggregate functions

in groupedinformation. It is similar to the WHERE clause in that the

HAVING keyword isfollowed by an expression that evaluates to true,

false, orunknown.You can test the expression by using standard comparison

operators, Booleanoperators, or special operators. HAVING is

also an optionalclause, and we’ll take a closer look at it in Chapter 14,

Filtering GroupedData.


点击复制链接 与好友分享!回本站首页
相关TAG标签 初学者 笔记 指南
上一篇:SQL查询初学者指南读书笔记(三)值表达式介绍
下一篇:SQL查询初学者指南读书笔记(一)关系数据库和SQL介绍
相关文章
图文推荐
文章
推荐
点击排行

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训
版权所有: 红黑联盟--致力于做实用的IT技术学习网站