in reply to (OT) Exclusion selection on DBI
Obviously not a perl question, however:
should normally work (untested, though).select fruit, color from fruit_table where fruit in (select fruit from fruit_table group by fruit having count(*) > 1) order by fruit
Michael
Update: moritz's solution is cleaner (and probably faster, if it matters), but has an additional column in the result set (which probably doesn't matter, so a better solution overall :-)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: (OT) Exclusion selection on DBI
by roboticus (Chancellor) on Jan 25, 2008 at 13:04 UTC | |
by mpeppler (Vicar) on Jan 25, 2008 at 13:16 UTC | |
Re^2: (OT) Exclusion selection on DBI
by fernandes (Monk) on Jan 25, 2008 at 14:08 UTC | |
by moritz (Cardinal) on Jan 25, 2008 at 14:14 UTC |
In Section
Seekers of Perl Wisdom