Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

How to create indexed view ?

$
0
0
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


Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>