On 05/04/2012 07:13 AM, Ricardo Araoz wrote:
> 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?

If the md5sum is identical, the file is identical and I want to keep
only one instance of the file.  It does not matter which one.  File
names may be changed later anyway.

After I clean up my mess, I hope to use some sort of document management
system (using Dabo & postgresql) to maintain order.

Thanks everyone.  I have a lot to learn.

Regards,

Bill
>
>
> _______________________________________________
> 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]
>
>

_______________________________________________
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]

Reply via email to