Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.85 KB | None | 0 0
  1. SELECT [CustomerKey]
  2.       ,[GeographyKey]
  3.       ,[CustomerAlternateKey]
  4.       ,[FirstName]
  5.       ,[LastName]
  6.       ,[NameStyle]
  7.       ,[BirthDate]
  8.       ,[MaritalStatus]
  9.       ,[Gender]
  10.       ,[EmailAddress]
  11.       ,[YearlyIncome]
  12.       ,[TotalChildren]
  13.       ,[NumberChildrenAtHome]
  14.       ,[EnglishEducation]
  15.       ,[SpanishEducation]
  16.       ,[FrenchEducation]
  17.       ,[EnglishOccupation]
  18.       ,[SpanishOccupation]
  19.       ,[FrenchOccupation]
  20.       ,[NumberCarsOwned]
  21.       ,[AddressLine1]
  22.       ,[AddressLine2]
  23.       ,[DateFirstPurchase]
  24.       ,[CommuteDistance]
  25.     INTO [dbo].[DimCustomNueva]
  26.   FROM [dbo].[DimCustomer]
  27.  
  28. CREATE VIEW [dbo].[vTargetCustom] AS (
  29. SELECT mail.*, CASE WHEN SalesAmount > 486 THEN 1 ELSE 0 END AS SalesAVGflg
  30.   FROM [dbo].[vTargetMail] mail
  31.   JOIN FactInternetSales fact
  32.     ON mail.CustomerKey = fact.CustomerKey)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement