I have one table called Visit and another called Measurement. Primary key on Visit is vis_id and it is also foreign key in table Measurement. Now I would like to write a report based on data in table Measurement on following conditions:
Visit has field "itemAmount". I want only have data that has itemAmount = 2 in table Visit and both rows in Measurement related to Visit have measurement1 and measurement2 not null in table Measurement. If either one has either measurement1 or measurement2 NULL, then neither of the rows should be included.
How to do this? I know how to join and how to write simple conditions in where clause but I have no idea how to test this "couple feature", ie to test that BOTH rows related to Visit have both measurement1 and measurement2 different from null.