El 03/05/12 23:26, Dennis Lee Bieber escribió:
> On Thu, 03 May 2012 21:05:38 -0300, Ricardo Araoz
> <[email protected]> declaimed the
> following in gmane.comp.python.dabo.user:
>
>> El 03/05/12 10:05, John Fabiani escribió:
>>> On Thursday, May 03, 2012 07:15:46 AM Ricardo Araoz wrote:
>>>> Don't know if I understood what you want. I think you want to get rid of
>>>> duplicate records.
>>>> It it is so, then in SQL is really simple :
>>>>
>>>> select distinct * from TheTable
>>>>
>>>> T t t t that's all folks.
>>> He wants all the dups removed but the last one.
>>>
>>> Johnf
>>>
>> So I was right (the last one is the same as any other dup) the "select
>> distinct" will do it easily.
> Not quite... The specification was that the ordering was
> MD5-path-file, but duplicates were only determined by MD5.
I see. And you want the longest path for a given md5 is what you want.
Are the "path" fields unique for a given md5?
If they are, then you could use
select *
from theTable TT
inner join (select md5, max(path) as 'path'
from theTable
group by md5
) lastOnes
on lastOnes.md5 = TT.md5
and lastOnes.path = TT.path
to get the subset you want.
If they are not, then how do you decide between two tuples with the same
md5-path?
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]