Tag Archive for 'distinct'

Writting Bad Query To Achieve Better Query

Add a comment

That title is sounding odd I admit it.
In the french forums développez.net there is a regular mistake that I try to emphasize on each time I read it, it's the use of GROUP BY without any aggregate functions to perform a regular DISTINCT operation.
Here's a very simple example (if you're not working on Oracle just [...]

Is Distinct A Synonym To Order By In MS SQL Server ?

1 Comment

This afternoon, I was chatting with Antoine Gémis about T-SQL, and this subject came on the table.
He was asking if, in my opinion, using both a distinct and an order by in the same statement would make the query worst due to the fact that distinct is already performing a sort on his own.
Working mostly [...]