"NOTE 130 — Unlike most regular expression languages, is not equivalent to the quantifier {0,1}: the quantifier {0,1} exposes variables as group, whereas does not change the singleton variables that it exposes to group. However, does expose any singleton variables as conditional singletons."
The way to translate this would be with a LEFT OUTER JOIN
select * from student s
join know k on s.id = k.src
join student s2 on s2.id = k.dst
left join studyat sa on sa.studentid = s.id
join university u on sa.universityid = u.id;
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Many SNB queries such as IC1, IC4, IC5 (see https://github.com/cwida/duckpgq-experiments/issues/26 for all) require optional matches. The PGQ syntax would be
()-[]->?()
.Snippet from the SQL/PGQ specification section 10.6:
"NOTE 130 — Unlike most regular expression languages, is not equivalent to the quantifier {0,1}: the quantifier {0,1} exposes variables as group, whereas does not change the singleton variables that it exposes to group. However, does expose any singleton variables as conditional singletons."
The way to translate this would be with a
LEFT OUTER JOIN