El 04/05/12 09:28, Bill House escribió: > On 05/04/2012 07:13 AM, Ricardo Araoz wrote: >> >> 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. >
All right then! Then the select will give you the set you want to keep without further hassle. If you want to delete the duplicates then you do a delete based on this select (NOT in this select actually). No need for any other complication, just one plain sql sentence sent to the server. _______________________________________________ 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]
