Re: duplicate rows
- From: bret@xxxxxxxxxx
- Date: 19 Jun 2006 10:38:37 -0700
patrick wrote:
Hello,
I have 4 columns:
A B C 2007/01/01
A B C 2005/01/01
A B D 2007/01/01
I would want to extract duplicates rows on first 3 columns, but with
the max date.
Here, I should extract :
A B C 2007/01/01
I've tried with a table join (+ having count() > 1), but without
success.
Is there a sample way to solve this ?
Thanks in advance.
select col1, col2, col3, max(col4) from mytable group by col1, col2,
col3 having count(*) > 1
.
- References:
- duplicate rows
- From: patrick
- duplicate rows
- Prev by Date: Re: newbie: retrieve output from exec
- Next by Date: Recent updates at www.sypron.nl
- Previous by thread: duplicate rows
- Next by thread: newbie: retrieve output from exec
- Index(es):