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 / hitesh kumar vyas s

Performance wise Distinct is more effective than group by.
Since in group by it has to group and then provide the
result but this is not the case in distinct

Is This Answer Correct ?    3 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define Unique Key?

594


Explain what are partitioned views and distributed partitioned views?

583


What is the recovery model?

564


What is the difference between substr and charindex in the sql server?

511


What are different types of replication in sql server?

572






What is dml command?

547


what are different types of raid configurations? : Sql server database administration

489


What are different types of raid levels?

554


Which trace flags are enabled in sql server?

526


Why de-normalization required?

576


Can we create clustered index on composite key?

517


What stored procedure would you use to view lock information?

529


You accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover?

548


Is resultset an interface?

560


Explain about extended stored procedure?

490