2.2 DISTINCT
查询单次购买数量超过 5 的产品及其价格、单位
SQL
SELECT DISTINCT ProductID,Price,Unit
FROM Orders
WHERE Quantity>=5
SPL
| A | |
|---|---|
| 1 | =file(“Orders.ctx”).open().cursor@x(ProductID,Price,Unit;Quantity>=5) |
| 2 | =A1.groups(ProductID,Price,Unit) |
A2 groups 函数没有聚合表达式时相当于 DISTINCT
