locked
How to create indexed view ? RRS feed

  • Question

  • CREATE VIEW [dbo].[qlk_fact_opening_closing_stock_final31]
    AS
    SELECT
    a.period_key,
    a.reporting_period_key,
    a.product_key,
    opening_stock_unit,
    closing_stock_unit,
    std_cost_price,
    opening_stock_rand AS opening_stock_rand_cos,
    closing_stock_rand AS closing_stock_rand_cos,
    sep_price,
    (opening_stock_unit * sep_price) AS opening_stock_rand_sep,
    (closing_stock_unit * sep_price) AS closing_stock_rand_sep
    FROM edw.dbo.vw_fact_trading_statement a
    LEFT OUTER JOIN edw.dbo.vw_fact_single_exit_price e
    ON a.product_key=e.product_key 
    AND a.period_key=e.period_key
    GO

    Thursday, June 19, 2014 11:37 AM

Answers

All replies