I need to exclude data rows that have same auth_no when the discharge date is not null in any row.
So in the example below, all the rows with auth_no = 200 should be excluded because the last row has a discharge date. The report should only display the first row of data where auth_no = 100. Any sql help would be appreciated.
Service Date auth_no Discharge
1/5/2011 100 NULL
1/14/2011 200 NULL --should be exluded
1/18/2011 200 NULL --should be excluded
1/20/2011 200 NULL --should be excluded
2/4/2011 200 1/22/2011 -- all auth_no = 200 should be excluded as discharge date is not null in this row.