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 / anil sharma
Group apply before where clause and distinct apply after
where clause.
So group by is good.
| Is This Answer Correct ? | 4 Yes | 10 No |
Post New Answer View All Answers
How do you maintain database integrity where deletions from one table will automatically cause deletions in another table?
What are the disadvantages of indexes?
What is raid, and how it can influence database performance?
How to get @@error and @@rowcount at the same time?
What is the use of custom fields in report?
What is page in sql server?
What is query optimizer in sql server?
Is it safe to delete log files?
What are the requirements to use odbc connections in php scripts?
What do you mean by stored techniques? How would we use it?
What is replication and database mirroring?
Can a cursor be updated? If yes, how you can protect which columns are updated?
What is create statement?
What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?
How to verify a user name with sqlcmd tool?