| anil |
Posted: Apr 14, 2008 03:52:37 PM |
Total Post: 27
Joined: Dec, 2007
|
| what is the difference between distinct and group by and which one is work faster if we use those keyword in a query? |
|
|
Mohammed Taj |
| Posted: Apr 15, 2008 12:55:16 AM | |
|
Total Post: 704
Joined: Jul, 2007
|
Distinct or Group by both keyword is use for different different purpose.
1. Distinct give us Unique value from column
2. Group by give us group set of specified column.
|
|
|
|
|
Murtuja |
| Posted: Apr 15, 2008 02:47:15 AM | |
|
Total Post: 815
Joined: Jan, 2006
|
Hi,
If you simply want to select distinct records then you can use "group by" as alternate to "Distinct".And in such query there is no difference, you can compare execution plan.
http://awads.net/wp/2006/03/08/an-alternative-to-distinct/
|
|
|
|
|
Mohammed Taj |
| Posted: Apr 15, 2008 11:07:33 AM | |
|
Total Post: 704
Joined: Jul, 2007
|
Good,
I learnt new thing today :)
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |