[Solved] SQL distinct query with whole record [closed]


I’m sure there are lots of ways of doing what you want. Try this:

SELECT a.*
FROM FGEHF_DB.dbo.Tbl_Alotee a
JOIN 
(
    SELECT MAX(ID) AS ID
    FROM FGEHF_DB.dbo.Tbl_Alotee
    WHERE Plot_Id = '4117'  -- or other value
    GROUP BY alotee_name, alotee_fname, alotee_cnic
) b
ON a.ID = b.ID

I think we are getting closer now.

8

solved SQL distinct query with whole record [closed]