SQLTeam.com | Weblogs | Forums

Sql distinct?


#1

I'm sorry for such a noob question ...my brain is fried ...why won't my query return only one row??


#2

Disregard .... I replaced DISTINCT with TOP(1). For my purposes this will work.


#3

don't use TOP(1) without ORDER BY. You won't get reproducible results


#4

Service Date and ID columns are having unique values. Because of that distinct is not returning only one row. As per your functionality requirement you have to change the code accordingly like Max, Top