Skip to content

Commit

Permalink
fix: use the final keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed May 30, 2024
1 parent 90e90b1 commit f6185da
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions models/enrollment/fact_current_enrollments.sql
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
with
all_enrollment as (
select
course_key,
actor_id,
enrollment_mode,
enrollment_status,
emission_time,
row_number() over (
partition by course_key, actor_id order by emission_time desc
) as rn
from {{ ref("fact_enrollment_status") }}
),
enrollments as (
select course_key, actor_id, enrollment_status, enrollment_mode, emission_time
from all_enrollment
where rn = 1
select course_key, actor_id, enrollment_mode, enrollment_status, emission_time,
from {{ ref("fact_enrollment_status") }} FINAL
where enrollment_status = 'registered'
)

select
Expand Down

0 comments on commit f6185da

Please sign in to comment.