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: NOt EXISTS & NOT IN ???
Next Topic: ora-1555
Goto Forum:
  


Current Time: Wed Nov 27 03:13:16 CST 2024