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 to insert data with null values?
What are system databases in ms sql server?
What is primary key index?
What do mean by xml datatype?
Can a cursor be updated? If yes, how you can protect which columns are updated?
Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?
How you can get the list of largest tables in a database?
How to delete a login name in ms sql server?
Explain in details security in SQL azure?
How can we call UDF(User Define Function) using C# code in ASP.net ?
What are cursors and when they are useful?
What do you understand by a view? What does the with check option clause for a view do?
What are character string data types in ms sql server?
What is normalization? Explain its different types?
What is the significance of master, tempdb and model databases?