i am trying to teach myself SQL and of course I would like to follow best practices.
I have created two querys to find the latest record :
select * from AppSurvey where
DateLastUsed >= ( SELECT MAX(DateLastUsed) FROM AppSurvey)
and
select top 1 * from AppSurvey order by DateLastUsed desc
is one of these methods more efficent than the other or does it really matter
There is a similiar post on this site to what you are trying to get at.
For autoincrement fields: MAX(ID) vs TOP 1 ID ORDER BY ID DESC
The preferred answer seems to be: “In theory, they will use same plans and run almost same time”