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
Working with TLogs
Differentiate between a primary key and a unique key.
What is Federation and Federation Member?
If you want to send some data from access database to sql server database. What are different component of ssis will you use?
Do you know what are the steps to process a single select statement?
What is 1nf normalization form?
What is usually the first word in a sql query?
What are scalar functions in sql?
What do you mean by SQL injection attack?
I have all the primary data files, secondary data files as well as logs. Now, tell me can I still restore the database without having a full backup? : sql server database administration
How to defragment indexes with alter index ... Reorganize?
Give me a SQL Query to find out the second largest company?
What the different components of Replication and what is their use?
tell me what is blocking and how would you troubleshoot it? : Sql server database administration
Define outer join in sql server joins?