-
Notifications
You must be signed in to change notification settings - Fork 0
/
Create MBTI VW_Similarity_HOFF.sql
52 lines (34 loc) · 1.39 KB
/
Create MBTI VW_Similarity_HOFF.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
USE [MBTI]
GO
/****** Object: View [MBTI].[VW_Similarity_HOFF] Script Date: 9/6/2020 12:52:36 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** Object: View [MBTI].[VW_Similarity_MBTI] Script Date: 8/21/2020 1:39:49 PM ******/
--SET ANSI_NULLS ON
--GO
--SET QUOTED_IDENTIFIER ON
--GO
CREATE VIEW [MBTI].[VW_Similarity_HOFF] AS
SELECT
tSim.*
, tCountry.[SetCountryName] AS [Country_Adjusted]
--, tIter.[Introversion] AS [Introversion_User]
--, tIter.[Intuition] AS [Intuition_User]
--, tIter.[Thinking] AS [Thinking_User]
--, tIter.[Prospecting] AS [Prospecting_User]
--, tIter.[Assertiveness] AS [Assertiveness_User]
--, tIter.[Introversion] AS [Introversion_Difference]
--, tIter.[Intuition] AS [Intuition_User]
--, tIter.[Thinking] AS [Thinking_User]
--, tIter.[Prospecting] AS [Prospecting_User]
--, tIter.[Assertiveness] AS [Assertiveness_User]
FROM [MBTI].[MBTI].[TBL_Similarity_HOFF] tSim
INNER JOIN [MBTI].[MBTI].[TBL_CountryTranslations] tCountry
ON tSim.[Country] = tCountry.[GetCountryName]
--INNER JOIN [MBTI].[MBTI].[TBL_Iteration_MBTI] tIter
--ON tSim.[FK_ID_Iteration] = tIter.[PK_ID_Iteration_CountrySimilarity_MBTI]
WHERE tSim.[FK_ID_Iteration] = (SELECT MAX([FK_ID_Iteration]) FROM [MBTI].[MBTI].[TBL_Similarity_HOFF])
AND tCountry.[SetCountryName] NOT IN ('Africa East','Africa West','Arab countries')
GO