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
Can we use max in where clause?
How do I view a stored procedure in sql server query?
How will you go about resolving deadlocks?
What is the concept of optimization?
Mention the differences between sql server and mysql.
Differentiate between mongodb vs. Sql server?
How do I find the sql server version?
What is the correct order of the logical query processing phases?
What happens if the update subquery returns no rows in ms sql server?
How can you check the version of sql server?
How to encrypt data between dialogs?
What is query processing?
Explain what is dbcc?
What do you understand by a stored procedure?
What is the beast way to write CTE in SQL Server ?