doc-exports/docs/dws/tool/dws_16_0183.html
Lu, Huayi 27019c2991 DWS TOOL 830.201 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:35:25 +00:00

1.8 KiB

ROLLUP

group by column with rollup in MySQL needs to be converted to group by rollup (column) in GaussDB(DWS).

Input

select id,product_id,count(1) from czb_account.equity_account_log
where id in (6957343,6957397,6957519,6957541,6957719)
group by 1, 2 with rollup;

Output

SELECT
  id,
  product_id,
  count(1)
FROM
  czb_account.equity_account_log
WHERE
  id IN (6957343, 6957397, 6957519, 6957541, 6957719)
GROUP BY
  ROLLUP(1, 2);