JOIN in SQL with one-to-many relationship
- by Kristopher Ives
I'm making a tool to track calls to house/senate reps, and I have 2 tables of importance here:
reps
rep_id
rep_name # and more info
comments
rep_id
status # enum about result of contact
comment
I want to query for all reps joining the most recent associated comments and in some cases joining comments of a specific status, but there might not be any comments associated with that rep yet.
THANKS!