Skip to content

Commit fd36493

Browse files
authored
Update sql-questions-01.md
1 parent 2846e85 commit fd36493

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/database/sql/sql-questions-01.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ ORDER BY c.cust_name,o.order_num
13371337

13381338
这是错误的!只对 `cust_name` 进行聚类确实符合题意,但是不符合 `GROUP BY` 的语法。
13391339

1340-
select 语句中,如果没有 `GROUP BY` 语句,那么 `cust_name``order_num` 会返回若干个值,而 `sum(quantity _ item_price)` 只返回一个值,通过 `group by` `cust_name` 可以让 `cust_name``sum(quantity _ item_price)` 一一对应起来,或者说**聚类**,所以同样的,也要对 `order_num` 进行聚类。
1340+
select 语句中,如果没有 `GROUP BY` 语句,那么 `cust_name``order_num` 会返回若干个值,而 `sum(quantity * item_price)` 只返回一个值,通过 `group by` `cust_name` 可以让 `cust_name``sum(quantity * item_price)` 一一对应起来,或者说**聚类**,所以同样的,也要对 `order_num` 进行聚类。
13411341

13421342
> **一句话,select 中的字段要么都聚类,要么都不聚类**
13431343

0 commit comments

Comments
 (0)