-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fc135b
commit e45ec6f
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
SELECT | ||
customer_rk, | ||
CASE | ||
WHEN middle_nm LIKE '%ИЧ' THEN 'M' | ||
WHEN middle_nm LIKE '%НА' THEN 'F' | ||
END AS gender | ||
FROM srcdt.cd_customers | ||
WHERE valid_to_dttm = '5999-01-01 00:00:00' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
SELECT | ||
monthly_income_amt | ||
FROM | ||
srcdt.cd_customers | ||
WHERE | ||
YEAR(valid_from_dttm) <= 2014 | ||
AND YEAR(valid_to_dttm) >= 2014 | ||
ORDER BY monthly_income_amt DESC | ||
LIMIT 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
SELECT DISTINCT | ||
CONCAT(YEAR(birth_dt) DIV 10, '0-е') AS generation | ||
FROM | ||
srcdt.cd_customers | ||
WHERE | ||
valid_to_dttm = '5999-01-01 00:00:00' | ||
ORDER BY generation DESC |