Skip to content

Commit

Permalink
standardize transaction abbreviation
Browse files Browse the repository at this point in the history
  • Loading branch information
ghukill committed Jul 10, 2024
1 parent c599cba commit 2ab8382
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hrqb/tasks/sql/employees.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ CHANGELOG
or retirement reason
*/

with ordered_appt_txns as (
with ordered_appt_txn as (
select
a.MIT_ID,
at.HR_PERSONNEL_ACTION,
at.HR_ACTION_REASON,
row_number() over (
partition by a.MIT_ID
order by a.APPT_TX_BEGIN_DATE desc, a.APPT_TX_END_DATE desc
) as tx_row_num
) as txn_row_num
from HR_APPT_TX_DETAIL a
left join HR_PERSONNEL_ACTION_TYPE at on at.HR_PERSONNEL_ACTION_TYPE_KEY = a.HR_PERSONNEL_ACTION_TYPE_KEY
where at.HR_PERSONNEL_ACTION in ('Termination','Retirement')
Expand All @@ -25,8 +25,8 @@ last_appt_txn as (
MIT_ID,
HR_PERSONNEL_ACTION,
HR_ACTION_REASON
from ordered_appt_txns
where tx_row_num = 1
from ordered_appt_txn
where txn_row_num = 1
)
select
e.MIT_ID,
Expand Down

0 comments on commit 2ab8382

Please sign in to comment.