mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 04:15:04 +03:00
Merge pull request #5251 from Robert-Nickel/master
Fixed left join syntax: use _on_ not _where_.
This commit is contained in:
1 file changed
+8
-8
@@ -62,8 +62,8 @@ create view transcripts as
|
||||
courses.code,
|
||||
grades.result
|
||||
from grades
|
||||
left join students where grades.student_id = students.id
|
||||
left join courses where grades.course_id = courses.id;
|
||||
left join students on grades.student_id = students.id
|
||||
left join courses on grades.course_id = courses.id;
|
||||
```
|
||||
|
||||
Once done, we can now access the underlying query with:
|
||||
@@ -95,8 +95,8 @@ select
|
||||
courses.code,
|
||||
grades.result
|
||||
from grades
|
||||
left join students where grades.student_id = students.id
|
||||
left join courses where grades.course_id = courses.id;
|
||||
left join students on grades.student_id = students.id
|
||||
left join courses on grades.course_id = courses.id;
|
||||
```
|
||||
|
||||
We can run this instead:
|
||||
@@ -119,8 +119,8 @@ select
|
||||
courses.code,
|
||||
grades.result
|
||||
from grades
|
||||
left join students where grades.student_id = students.id
|
||||
left join courses where grades.course_id = courses.id
|
||||
left join students on grades.student_id = students.id
|
||||
left join courses on grades.course_id = courses.id
|
||||
where courses.code != 'PG101';
|
||||
```
|
||||
|
||||
@@ -151,8 +151,8 @@ create materialized view transcripts as
|
||||
courses.code,
|
||||
grades.result
|
||||
from grades
|
||||
left join students where grades.student_id = students.id
|
||||
left join courses where grades.course_id = courses.id;
|
||||
left join students on grades.student_id = students.id
|
||||
left join courses on grades.course_id = courses.id;
|
||||
```
|
||||
|
||||
Reading from the materialized view is the same as a conventional view:
|
||||
|
||||
Reference in new issue
Block a user