select * from PatientsTable P inner join ForcedSpiroTable F on (P.ID = F.ID) inner join RelaxedSpiroTable R on (P.ID = R.ID) where F.EVC > 2.0 and R.FVC > 2.0
RBS > Hi, > > Can anyone offer any help with the following SQL query? > > I have a database that looks something like the following:- > > PatientsTable { ID, Name, Sex, ....} > ExaminationsTable { ID, PatientID, ....} > TestTable { ID, ExamID, .....} > ForcedSpiroTable { ID, TestID, EVC, IVC, IC ... } > RelaxedSpiroTable { ID, TestID, FVC, FEV1, PEF, ...} > > Can someone help me out with the syntax for applying a search for all rows > in the PatientsTable that have a ForcedSpiroTable.EVC > 2.0 and a > RelaxedSpiroTable.FVC > 2.0? > > > Basically ExaminationsTable has a foreign key to PatientsTable, TestsTable > has a foreign key to ExaminationsTable and both ForcedSpiroTable and > RelaxedSpiroTable have a foreign key to the TestTable. > > Your help would be gratefully received.... > > Thanks in advance > > Mark > > > DISCLAIMER: > This information and any attachments contained in this email message is > intended only for the use of the individual or entity to which it is > addressed and may contain information that is privileged, confidential, > and exempt from disclosure under applicable law. If the reader of this > message is not the intended recipient, or the employee or agent > responsible for delivering the message to the intended recipient, you are > hereby notified that any dissemination, distribution, forwarding, or > copying of this communication is strictly prohibited. If you have > received this communication in error, please notify the sender immediately > by return email, and delete the original message immediately. > ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------