Forum

Posted by Iron, Aug. 3, 2022, 4:45 a.m.

Question 199

As there is no online judge for question 199 I would like to share my solution:

 

Would it work?

==========================================================

with this_week as (
    select distinct student_id
    from snap_test_results
    where date_part('week', current_date) = date_part('week', date)
  ),
last_week as (
      select distinct student_id
    from snap_test_results
    where date_part('week', current_date) - 1 = date_part('week', date)
  )
  
diff as (
      select student_id from this_week
    where student_id not in (
          select student_id from last_week 
      )
  )

=================================================================

Answers

Looks about right @Iron!

We are going to add the online judge very soon!

SQLPad user avatar

Leon (949)

Aug. 31, 2022, 9:59 a.m.