Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can we use max in where clause?

983


How do I view a stored procedure in sql server query?

980


How will you go about resolving deadlocks?

1034


What is the concept of optimization?

1110


Mention the differences between sql server and mysql.

1086


Differentiate between mongodb vs. Sql server?

1142


How do I find the sql server version?

1081


What is the correct order of the logical query processing phases?

995


What happens if the update subquery returns no rows in ms sql server?

1177


How can you check the version of sql server?

1160


How to encrypt data between dialogs?

1169


What is query processing?

990


Explain what is dbcc?

1067


What do you understand by a stored procedure?

1153


What is the beast way to write CTE in SQL Server ?

1094