SQL/MX Quick Start (G06.24+, H06.03+)

Displaying Information About Groups of Rows
HP NonStop SQL/MX Quick Start523724-002
4-3
Grouping and Ordering Rows
Example
Find the earliest delivery date for the complete set of customers. If you do not specify a
GROUP BY clause, all rows belong to the same group (the entire table). In this case,
you must also omit CUSTNUM from the select list because there is no single customer
for the entire table:
SELECT MIN(DELIV_DATE)
FROM ORDERS;
The selected value is:
(EXPR)
-----------
2003-01-10
--- 1 row(s) selected.
Example
Find out more about the order or orders with the earliest delivery date:
SELECT * FROM ORDERS
WHERE DELIV_DATE = DATE '2003-04-10';
The selected value is:
Order/Num Order/Date Deliv/Date Sales/Rep Cust/Num
---------- ---------- ---------- -------- --------
100210 2003-04-10 2004-04-10 220 1234
--- 1 row(s) selected.