SQL/MX 2.x Query Guide (G06.24+, H06.03+)
Operators and Operator Groups
HP NonStop SQL/MX Query Guide—523728-003
7-48
SORT_SCALAR_AGGR Operator
The example of the SORT_PARTIAL_GROUPBY_ROOT operator is based on:
SELECT o_orderpriority, COUNT(*)
FROM $big18a.tpcd2x.orders
WHERE o_orderdate >= DATE '1993-07-01'
AND o_orderdate < DATE '1993-10-01'
AND EXISTS (SELECT *
FROM $big18a.tpcd2x.lineitem
WHERE l_orderkey = o_orderkey
AND l_commitdate < l_receiptdate)
GROUP BY o_orderpriority
ORDER BY o_orderpriority;
10 . 11 sort_partial_groupby_root grouping_columns:
indexcol(\TESTSYS.$BIG18A.TPCD2X.ORDERS.O_ORDERPRIORITY)
aggregates: sum(count(1 ))
SORT_SCALAR_AGGR Operator
Groupby Group
The SORT_SCALAR_AGGR operator occurs for aggregates without a GROUP BY
clause. It returns one row. The description field for this operator contains:
The example of the SORT_SCALAR_AGGR operator is based on:
SELECT s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address,
s_phone, s_comment
FROM part,supplier,partsupp, nation, region
WHERE p_partkey = ps_partkey
AND s_suppkey = ps_suppkey
AND p_size = 15
AND p_type like '%BRASS'
AND s_nationkey = n_nationkey
AND n_regionkey = r_regionkey
AND r_name = 'EUROPE'
AND ps_supplycost = (SELECT MIN(ps_supplycost)
FROM partsupp ps1,supplier s1, nation n1,region r1
WHERE p_partkey = ps1.ps_partkey
AND s1.s_suppkey = ps1.ps_suppkey
AND s1.s_nationkey = n1.n_nationkey
AND n1.n_regionkey = r1.r_regionkey
AND r1.r_name = 'EUROPE’
ORDER BY s_acctbal desc, n_name, s_name, p_partkey;
? XX
211862597476194167 34 SORT_SCALAR_AGGR
3 3 ?
Token Followed by... Data Type
aggregates Expression of the
aggregate functions
expr(text)
selection_predicates Expression of the
having clause
expr(text)