Union //把两种数据集合起来
SELECT City FROM Customers
UNION
SELECT City FROM Suppliers
ORDER BY City;
Group By // 由什么来分组, Having是聚合后筛选
The GROUP BY statement groups rows that have the same values into summary rows, like "find the number of customers in each country".
SELECT COUNT(CustomerID), Country
FROM Customers
GROUP BY Country;
网友评论