Skip to content
Advertisement

Flag if there is a JOIN – SQL

Two tables with same field names >> student.id in student table (a) and student.id in record table (b)

If student.id from student table is also in record table (join on a.student.id = b.student.id) then say “Yes” else “No” as “match”

Advertisement

Answer

If there are no duplicates, then you can use a left join:

If there can be duplicates, then remove the duplicates before joining:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement