Sql distinct?

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

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

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

1 Like

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