-
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.
Add Kholodov solutions (dated Oct 2 10:43) (#55)
- Loading branch information
1 parent
80da889
commit 76b9a52
Showing
3 changed files
with
17 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,7 @@ | ||
SELECT customer_rk, | ||
(CASE | ||
WHEN middle_nm LIKE '%ИЧ' THEN 'M' | ||
WHEN middle_nm LIKE '%А' THEN 'F' | ||
END) AS gender | ||
FROM cd_customers | ||
WHERE valid_to_dttm = '5999-01-01' |
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,5 @@ | ||
SELECT monthly_income_amt | ||
FROM cd_customers | ||
WHERE valid_to_dttm >= '2014.01.01' AND valid_from_dttm < '2015.01.01' | ||
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,5 @@ | ||
SELECT DISTINCT | ||
CONCAT(SUBSTRING(birth_dt, 1, 3), '0-e') as generation | ||
FROM cd_customers | ||
WHERE valid_to_dttm = '5999-01-01' | ||
ORDER BY generation DESC; |