I have a table plasmid_table with key plasmid_id (not shown), which is associated to an antibiotic table (also not shown) with primary key antibiotic_id by way of the table below named plasmid_to_antibiotic_table.
plasmid_fk antibiotic_fk
14 1
15 1
16 1
17 1
18 1
19 1
20 1
26 4
26 5
I want to find the sole plasmid record that references both antibiotics 4 and 5, which is plasmid_fk 26, so I did a search as follows
SELECT plasmidName_col FROM plasmid_table
INNER JOIN plasmid_to_antibiotic_table ON plasmid_table.plasmid_id = plasmid_to_antibiotic_table.plasmid_fk
INNER JOIN antibiotic_table ON plasmid_to_antibiotic_table.antibiotic_fk = antibiotic_table.antibiotic_id
WHERE (antibiotic_table.antibiotic_id = 4 AND antibiotic_table.antibiotic_id = 5)
but this yields no results. Does this mean that it's not possible to construct an AND search this way, and I would have to do two independent searches and union them?