| select cast(case when ss_sold_date_sk is null then 0 else ss_sold_date_sk end as int) as soldd, cast(case when ss_sold_time_sk is null then 0 else ss_sold_time_sk end as bigint) as soldt, cast(case when ss_item_sk is null then 0.0 else ss_item_sk end as float) as itemsk, cast(case when ss_customer_sk is null then 0.0 else ss_customer_sk end as decimal(18,9)) as custsk, cast(case when ss_cdemo_sk is null then 0 else ss_cdemo_sk end as varchar(20)) as cdemo, ss_hdemo_sk as hdemo, ss_addr_sk as addrsk, ss_store_sk as storesk, ss_promo_sk as promo, ss_ticket_number as tickn, sum(ss_quantity) as quantities from store_sales group by cast(case when ss_sold_date_sk is null then 0 else ss_sold_date_sk end as int), cast(case when ss_sold_time_sk is null then 0 else ss_sold_time_sk end as bigint), cast(case when ss_item_sk is null then 0.0 else ss_item_sk end as float), cast(case when ss_customer_sk is null then 0.0 else ss_customer_sk end as decimal(18,9)), cast(case when ss_cdemo_sk is null then 0 else ss_cdemo_sk end as varchar(20)), ss_hdemo_sk, ss_addr_sk, ss_store_sk, ss_promo_sk, ss_ticket_number order by cast(case when ss_sold_date_sk is null then 0 else ss_sold_date_sk end as int), cast(case when ss_sold_time_sk is null then 0 else ss_sold_time_sk end as bigint), cast(case when ss_item_sk is null then 0.0 else ss_item_sk end as float), cast(case when ss_customer_sk is null then 0.0 else ss_customer_sk end as decimal(18,9)), cast(case when ss_cdemo_sk is null then 0 else ss_cdemo_sk end as varchar(20)), ss_hdemo_sk, ss_addr_sk, ss_store_sk, ss_promo_sk, ss_ticket_number limit 100; |