consider a table "SCHOOL" table, which contains the below data
when, duplicates found in NAME and LAST NAME combination it should look up for the STATUS which is "Active". if still it has duplicates, then look up for JOIN DATE which is most recent.
So the "SELECT" query should fetch S.NO 1,2,3,4,7.
S.NO 7 has ACTIVE status with most recent date
So could you please let me know the SQL Query to fetch these results?