pileofrogs has asked for the wisdom of the Perl Monks concerning the following question:
Blessings upon ye monks!
First, this question is total Monk abuse. It's an SQL question, not a perl question (though I will be using the advice generated by this question in a perl script.) However, the Monks are the best people on the net, the smartest, the best able to parse my stupidly-worded questions, sexiest, best dressed etc... If I wanted advice buying a car, I would probably ask on PerlMonks...
If you know a good, more appropriate venue for this kind of question, please feel free to include it with your downvote.
Achem.. the question...
I want to get all the rows out of a table where one particular field has the same value in at least two rows. Er... I want all the rows with matching values in a particular field, and I don't know what the values are, I just want the ones where that value matches.
Here's the background:
I'm looking for duplicate files on my computer.
I have two tables in sqlite like so:
create table files ( id integer primary key, path text unique, md5 int +eger); create table md5s ( id integer primary key, md5 text unique);
A process (writen in perl!) is presently running that is filling up these tables such that each file's md5 integer is the id integer in the md5s table. I want to get the names of files that have the same md5sum, and I'm almost positive I can do that with a select statement but I have no idea how to start.
Did I mention I suck at SQL? I suck at SQL.
Again, any links to good resource for a loser like me would be greatly appreciated and might even lead to fewer stupid questions like this wasting your time.
Let the downvotes begin!
--Pileofrogs
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dumb SQL Question
by bart (Canon) on Mar 02, 2010 at 20:32 UTC | |
by pileofrogs (Priest) on Mar 02, 2010 at 21:04 UTC | |
by bart (Canon) on Mar 02, 2010 at 21:14 UTC | |
|
Re: Dumb SQL Question
by zwon (Abbot) on Mar 02, 2010 at 20:18 UTC | |
|
Re: Dumb SQL Question
by fod (Friar) on Mar 02, 2010 at 20:20 UTC | |
by pileofrogs (Priest) on Mar 02, 2010 at 20:55 UTC |