I am trying to write a SQL statement that will compare one row to the next, then eliminate the rows not needed.
Example:
Table: TLV_DischargeDates
FamilyKey Program
5723 2
5830 3
8473 5
8473 6
8493 1
8930 3
14710 5
14710 6
14710 10
The FamilyKey must not be in more than one program. Those that are need to be eliminated from the list. Only the FamilyKey equal Program 6 are to remain in the list. How can I write this in a SQL statement?
Example:
Table: TLV_DischargeDates
FamilyKey Program
5723 2
5830 3
8473 5
8473 6
8493 1
8930 3
14710 5
14710 6
14710 10
The FamilyKey must not be in more than one program. Those that are need to be eliminated from the list. Only the FamilyKey equal Program 6 are to remain in the list. How can I write this in a SQL statement?