Home » RDBMS Server » Performance Tuning » SQL Tuning - Distinct Vs Group by
SQL Tuning - Distinct Vs Group by [message #220561] Wed, 21 February 2007 05:01 Go to next message
amit_nanote
Messages: 56
Registered: July 2005
Location: Indore
Member

Hi all,
I am having a table say
e(empname, phone) where one emp can have more then one phone number.
To get the distinct empname from the table I can use following two queries -
1. select distinct empname from e;
2. Select empname from e group by empname;

Which one is more efficient and why?
With regards
Amit Nanote
Re: SQL Tuning - Distinct Vs Group by [message #220563 is a reply to message #220561] Wed, 21 February 2007 05:07 Go to previous message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Check this
link , that will give you what you're looking for
Previous Topic: The 10 Longest Running Query
Next Topic: while block is being read.....
Goto Forum:
  


Current Time: Sun Aug 20 14:21:19 CDT 2017

Total time taken to generate the page: 0.01558 seconds