SqlServer中怎么用查询最快的找到最新的一条记录?

selecttop1*fromtableorderbyIDdesc

sql数据库查询保留最新的值?

select*

fromtableW

whereid=(selectMAX(id)fromtablewhereSN=W.SNANDPort=W.Port)