In performance wise distinct is good or group by is good?
eg:select name from emp group by name;
select distinct name from emp;
Answer Posted / ghorban adabi
I have test DISTINCT and GROUP BY query on a table in my
site db with 7800 record. the results that turned GROUP BY
was faster than DISTINCT!!!
GROUP BY result -> Query took 0.0094 sec
DISTINCT result -> Query took 0.0133 sec
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is dirty read?
how to trace the traffic hitting a sql server? : Sql server database administration
Explain sql server authentication modes?
Explain some stored procedure creating best practices or guidelines?
What are the purposes of floor and sign functions?
What are the differences between union, intersect, and minus operators?
What it means to be triggered?
Can We Use Data-grids For Our Report In Ssrs?
Explain how to use linked server?
How to resolve the orphan use problem? : sql server security
What is the advantage of sql server?
What does COMMIT command do?
What is the New in SQL server 2008?
What is the difference between varchar and varchar(max) datatypes?
What is the difference between varchar and nvarchar?