Skip to content

Commit

Permalink
Fix q66 (make it same as yql version) (ydb-platform#4543)
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius authored May 15, 2024
1 parent 58b04a5 commit 72525ef
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions ydb/library/benchmarks/queries/tpcds/pg/q66.sql
Original file line number Diff line number Diff line change
Expand Up @@ -80,29 +80,29 @@ select
,sum(case when d_moy = 12
then ws_sales_price* ws_quantity::numeric else 0::numeric end) as dec_sales
,sum(case when d_moy = 1
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as jan_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as jan_net
,sum(case when d_moy = 2
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as feb_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as feb_net
,sum(case when d_moy = 3
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as mar_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as mar_net
,sum(case when d_moy = 4
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as apr_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as apr_net
,sum(case when d_moy = 5
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as may_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as may_net
,sum(case when d_moy = 6
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as jun_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as jun_net
,sum(case when d_moy = 7
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as jul_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as jul_net
,sum(case when d_moy = 8
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as aug_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as aug_net
,sum(case when d_moy = 9
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as sep_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as sep_net
,sum(case when d_moy = 10
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as oct_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as oct_net
,sum(case when d_moy = 11
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as nov_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as nov_net
,sum(case when d_moy = 12
then ws_net_paid_inc_tax * ws_quantity::numeric else 0::numeric end) as dec_net
then ws_net_paid_inc_ship_tax * ws_quantity::numeric else 0::numeric end) as dec_net
from
{{web_sales}}
,{{warehouse}}
Expand Down Expand Up @@ -136,53 +136,53 @@ select
,'MSC' || ',' || 'GERMA' as ship_carriers
,d_year as year
,sum(case when d_moy = 1
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as jan_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as jan_sales
,sum(case when d_moy = 2
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as feb_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as feb_sales
,sum(case when d_moy = 3
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as mar_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as mar_sales
,sum(case when d_moy = 4
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as apr_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as apr_sales
,sum(case when d_moy = 5
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as may_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as may_sales
,sum(case when d_moy = 6
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as jun_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as jun_sales
,sum(case when d_moy = 7
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as jul_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as jul_sales
,sum(case when d_moy = 8
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as aug_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as aug_sales
,sum(case when d_moy = 9
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as sep_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as sep_sales
,sum(case when d_moy = 10
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as oct_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as oct_sales
,sum(case when d_moy = 11
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as nov_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as nov_sales
,sum(case when d_moy = 12
then cs_ext_sales_price* cs_quantity::numeric else 0::numeric end) as dec_sales
then cs_ext_list_price* cs_quantity::numeric else 0::numeric end) as dec_sales
,sum(case when d_moy = 1
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as jan_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as jan_net
,sum(case when d_moy = 2
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as feb_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as feb_net
,sum(case when d_moy = 3
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as mar_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as mar_net
,sum(case when d_moy = 4
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as apr_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as apr_net
,sum(case when d_moy = 5
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as may_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as may_net
,sum(case when d_moy = 6
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as jun_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as jun_net
,sum(case when d_moy = 7
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as jul_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as jul_net
,sum(case when d_moy = 8
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as aug_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as aug_net
,sum(case when d_moy = 9
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as sep_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as sep_net
,sum(case when d_moy = 10
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as oct_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as oct_net
,sum(case when d_moy = 11
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as nov_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as nov_net
,sum(case when d_moy = 12
then cs_net_paid_inc_ship_tax * cs_quantity::numeric else 0::numeric end) as dec_net
then cs_net_paid_inc_ship * cs_quantity::numeric else 0::numeric end) as dec_net
from
{{catalog_sales}}
,{{warehouse}}
Expand Down

0 comments on commit 72525ef

Please sign in to comment.