102 | | SELECT t.* |
103 | | FROM task t |
104 | | JOIN dashboard_task dt ON t.task_id = dt.task_id |
105 | | JOIN dashboard d ON dt.student_id = d.student_id |
106 | | JOIN calendar_event ce ON d.dashboard_date = ce.event_start_time::date |
107 | | WHERE d.student_id = chosen_student_id |
108 | | AND ce.event_start_time BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL '3 days'; |
| 102 | |
| 103 | SELECT |
| 104 | t.task_name, |
| 105 | t.task_description, |
| 106 | t.task_date, |
| 107 | t.task_priority |
| 108 | FROM |
| 109 | task AS t |
| 110 | JOIN |
| 111 | student_task AS st ON t.task_id = st.task_id |
| 112 | JOIN |
| 113 | creates_task AS ct ON t.task_id = ct.task_id |
| 114 | JOIN |
| 115 | subject_at_term AS sat ON ct.term_subject_id = sat.term_subject_id |
| 116 | AND ct.term_type = sat.term_type |
| 117 | AND ct.starting_year = sat.starting_year |
| 118 | AND ct.finishing_year = sat.finishing_year |
| 119 | AND ct.student_id = sat.student_id |
| 120 | WHERE |
| 121 | st.student_id = correct_student_id |
| 122 | AND t.task_date BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL '3 days' |
| 123 | ORDER BY |
| 124 | t.task_priority; |