I have 3 tables,
– Section table that defines some general item sections.
– Category table -> has a “section” column (foreign key).
– Product table -> has a “category” column (foreign key).
I want to get all products that belong to X section.
How can I do it?
select from select?
Lots of same answers here. For some reason, though, all of them are joining the
Sectiontable which is (likely) not necessary.Explicit ANSI
JOINsyntax per @nemiss’s request:Possible reason to include
Sectiontable: Selecting products based on Section name (instead of ID).If doing this, you’ll want to make sure
Section.nameis indexed