Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Display patients with unusual results of urea test and their doctor
- SELECT Patient.FName, Patient.LName,LabName, LabExamName,TestDate,TestResult,Units,TestIndicator,DFName,DLName,DSpecialty FROM
- Patient JOIN LabTest ON LabTest.PatientID = Patient.PatientID
- JOIN Doctor ON LabTest.DoctorID = Doctor.DoctorID
- JOIN LabTestResult ON LabTestResult.LabTestID = LabTest.LabTestID
- JOIN TestType ON LabTestResult.TestTypeID = TestType.TestTypeID
- WHERE TestType.TestIndicator = 'Urea' AND (LabTestResult.TestResult >TestType.MaxRefValues OR LabTestResult.TestResult < TestType.MinRefValue) ORDER BY Patient.FName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement