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
How do you delete a data source?
What is 1nf 2nf?
What is the new security features added in sql server 2014? : sql server security
What are the five characteristics of good data?
What are pessimistic lock and optimistic lock?
Do you know the policy based administration feature of sql server 2008?
How to make conditional sum in ssrs?
What is the difference between TRUNCATE and DROP?
Describe different Processing Modes offered by SSRS?
What is the difference between getdate and sysdatetime?
What is a select query statement in ms sql server?
How can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role?
What does null mean?
What is statement level trigger?
What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas