我需要写一个查询在这个表上的什么位置
CREATE TABLE sales (
OrderID INT,
OrderDate DATE,
OrderPrice INT,
OrderQuantity INT,
customerName VARCHAR(20)
);
这是我的table
+---------+------------+------------+---------------+--------------+
| OrderID | OrderDate | OrderPrice | OrderQuantity | customerName |
+---------+------------+------------+---------------+--------------+
| 1 | 2005-12-22 | 160 | 2 | Smith |
| 2 | 2005-08-10 | 190 | 2 | Johason |
| 3 | 2005-07-13 | 500 | 5 | Baldwin |
| 4 | 2005-07-15 | 420 | 2 | Smith |
| 5 | 2005-12-22 | 1000 | 4 | Wood |
| 6 | 2005-10-02 | 820 | 4 | Smith |
| 7 | 2005-11-03 | 2000 | 2 | Baldwin |
+---------+------------+------------+---------------+--------------+
在那里我需要得到所有花费超过1200英镑的独特客户的名字
1条答案
按热度按时间0tdrvxhp1#
使用聚合和
having
: