Re: help with simple sql
Posted in 2000
From: "dios" <adiosadios@crosswinds.net>
>
>What is the correct informix syntax for selecting all rows where the one
>column contains duplicates and the selection criteria is only on the one
>column? Right now I am running comparisons against the orig and a temp
>table.
>
>table:
>column 1 col 2
>ss01 01
>ss02
>ss01 02
>ss03
>ss01 03
>ss04 01
>ss04 02
>ss05
>
>output:
>col 1
>ss01 01
>ss01 02
>ss01 03
>ss04 01
>ss04 02
>
>search criteria is col 1 only! ss03 and ss05 are not included because they
>are unique
Not quite what you're after, I'm sure, but how about something like:
SELECT col1, col2, count(col2)
FROM table
GROUP BY col1, col2
HAVING count(col2) > 1
?
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com