I have 3 tables (archive has many sections, section (may) belong to many archives):
archiveid PKdescription
archive_to_sectionarchive_id PK FKsection_id PK FK
sectionid PKdescription
What would the SQL look like to list all the sections that belong a certain archive id?
I am just learning SQL. From what I've read it sounds like I would need a join, or union? FYI I'm using postgres.
[Edit] This is the answer from gdean2323 written without aliases:
SELECT section.*
FROM section
INNER JOIN archive_to_section
ON section.id = archive_to_section.section_id
WHERE archive_to_section.archive_id = $this_archive_id