query help
Posted in 2000
Topics: General Discussion
Hello, how can I return all occurrences of rows that occur more than once in a table if they have the same values in 3 columns??? example, row 1 and 3 match in columns 2,3 and 4 aaa|bbb|ccc|ddd|eee <-return this bbb|eee|fff|ggg|hhh fff|bbb|ccc|ddd|jjj <-return this also Thanks in advance, Jason
SELECT col1,col2,col3,count(*)
group by 1,2,3
having count(*) > 1
--
---------------------------------------
Tony Flaherty aef@mfs.misys.co.uk
Analyst Programmer
Misys Financial Systems
All statements and opinions are my own,
Misys don't pay me enough to have opinions
on their behalf
.
Jason wrote in message <38FED064.7BB960E7@paradise.net.nz>...
>Hello,
>
>how can I return all occurrences of rows that occur more than once in a
>table if they have the same values in 3 columns???
>
>example,
>
>row 1 and 3 match in columns 2,3 and 4
>
>aaa|bbb|ccc|ddd|eee <-return this
>bbb|eee|fff|ggg|hhh
>fff|bbb|ccc|ddd|jjj <-return this also
>
>Thanks in advance,
>Jason
>