I have a course table, each course has an id, a code and a start date. Example:
course_id course_code start_date
uuid1 course_a 2021-06-01
uuid2 course_a 2021-09-01
uuid3 course_b 2021-06-01
uuid4 course_b 2021-09-01
I want to get the latest record of each distinct course and I can do it in SQL
SELECT DISTINCT ON (course_code)
course_id,
course_code,
start_date
FROM course
ORDER BY course_code, start_date DESC
uuid2 course_a 2021-09-01
uuid4 course_b 2021-09-01
But is it possible to query in graphql?