List:General Discussion« Previous MessageNext Message »
From:Jasper Bryant-Greene Date:October 6 2005 11:41pm
Subject:Re: Selecting a group of distinct items?
View as plain text  
Manish Marathe wrote:
> of course, although DISTINCT(name) works

Yes, but writing it that way gives the impression that you are somehow 
"applying" DISTINCT only to the "name" column, which you're not. You're 
applying it to entire rows.

Oh, and can you please stop top-posting.

Jasper

> On Fri, 2005-10-07 at 12:29 +1300, Jasper Bryant-Greene wrote:
> 
>>Manish Marathe wrote:
>>
>>>SELECT DISTINCT(name), date, value FROM table_name ORDER BY date DESC;
>>
>>DISTINCT is not a function. The above (if it even works) is exactly 
>>equivalent to:
>>
>>SELECT DISTINCT name, date, value FROM table_name ORDER BY date DESC;
>>
>>and will match distinct rows (that is, combinations of name, date and 
>>value).
>>
>>-- 
>>Jasper Bryant-Greene
>>Freelance web developer
>>http://jasper.bryant-greene.name/
>>
> 
> 
> 
> 
> 

-- 
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/
Thread
Selecting a group of distinct items?Donnie Lynch6 Oct
  • Re: Selecting a group of distinct items?Manish Marathe7 Oct
    • Re: Selecting a group of distinct items?Jasper Bryant-Greene7 Oct
      • Re: Selecting a group of distinct items?Manish Marathe7 Oct
        • Re: Selecting a group of distinct items?Jasper Bryant-Greene7 Oct
  • Re: Selecting a group of distinct items?Chris7 Oct
  • Re: Selecting a group of distinct items?SGreen7 Oct