I have the query below, which may return identical records other than the 'logid' being different.
I want to display only those records which are different, in other words, records that are identical OTHER than the 'logid' which will be different since its an incremental ID.
The problem is if I remove the logid then I get the records I need, but then I can't order by logid :$ which I need to have the most recent record at the top.
Is there a way around this ?
SELECT DISTINCT TOP 6
FROM dbo.LogSearches a
INNER JOIN Users AS b ON b.UserId = a.fileid
WHERE a.firmid = 2
AND a.userid = 1713
AND a.filetype = 'contact'
ORDER BY a.logid DESC;