title: SQL - Create View from Multiple Views
body: <p>Just wondering, is it possible to create view from multiple views? </p>
  
  <p>I'm trying to create a view (Data_extract_C) from 2 views  (Data_extract_A and Data_Extract_B) by using Left Join. It's been an hour already and it still hasn't finished compiling the result. Is it normal?</p>
  
  <p>Below is the syntax that I'm using. </p>
  
  <pre><code> Create view [TeamA].[Data_Extract_C] as
  
      select distinct
  
      [TeamA].[Data_Extract_A].Unique_ID, 
      sum ([TeamA].[Data_Extract_A].TotalFilesInput), 
      sum ([TeamA].[Data_Extract_B].TotalFilesOutput)
  
      from [TeamA].[Data_Extract_A]
  
      left join 
  
      [TeamA].[Data_Extract_B] 
  
      on 
  
      [TeamA].[Data_Extract_A].Unique_ID = [TeamA].[Data_Extract_B].Unique_ID 
  
      group by [TeamA].[Data_Extract_A].Unique_ID
  
  go
  </code></pre>
  
  <p>Thanks all for your help. SQL Server 2012 is really new for me as I usually do data analysis using Excel. </p>