SQL查询初学者指南读书笔记(二)创建SQL查询

PARTII: SQL Basics

CHAPTER 4Creating a Simple Query


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

 

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

which we will refer to as the SELECT statement,the SELECT expression,

and the SELECT query.

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

 


 

 

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

GROUP BY—When you use aggregate functions in the SELECT clause

to produce summary information, you use the GROUP BY clause to

divide the information into distinct groups.Your database system uses

any column or list of columns following the GROUP BY keywords as

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

it further in Chapter 13, Grouping Data.

 

HAVING—The HAVING clause filters the result of aggregate functions

in grouped information. It is similar to the WHERE clause in that the

HAVING keyword is followed by an expression that evaluates to true,

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

operators, Boolean operators, or special operators. HAVING is

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

Filtering Grouped Data.


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值