CREATE VIEW $viewName AS
SELECT
    rb.transaction_date,
    rb.game_offering_id,
    rb.game_provider_id,
    rb.balance_category_id,
    rb.currency_id,
    rb.game_offering_name,
    rb.game_provider_name,
    rb.balance_category,
    rb.currency,
    SUM(rb.bet_amount) AS bet_amount,
    SUM(rb.preserve_amount) AS preserve_amount,
    SUM(rb.turn_over) AS turn_over,
    SUM(rb.win_amount) AS win_amount,
    SUM(rb.jackpot_amount) AS jackpot_amount,
    SUM(total_bet_count) AS total_bet_count
FROM $fromReportName rb
GROUP BY
    rb.transaction_date,
    rb.game_offering_id,
    rb.game_provider_id,
    rb.balance_category_id,
    rb.currency_id;