-
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
e45ec6f
commit 303e8a9
Showing
3 changed files
with
18 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 | ||
cd_customers.customer_rk, ( | ||
case | ||
when cd_customers.middle_nm like '%НА' then 'F' | ||
when cd_customers.middle_nm like '%ИЧ' then 'M' | ||
end | ||
) as gender | ||
from srcdt.cd_customers as cd_customers | ||
where cd_customers.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,5 @@ | ||
select cd_customers.monthly_income_amt | ||
from srcdt.cd_customers as cd_customers | ||
where 2014 >= year(cd_customers.valid_from_dttm) and year(cd_customers.valid_to_dttm) >= 2014 | ||
order by cd_customers.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,4 @@ | ||
select distinct concat(floor(year(cd_customers.birth_dt) / 10), '0-е') as generation | ||
from srcdt.cd_customers as cd_customers | ||
where cd_customers.valid_to_dttm = '5999-01-01 00:00:00' | ||
order by generation desc |