Re: help with simple sql
Posted in 2000
--- Carlos Benjamin <benj@firstlinux.net>
> wrote:
>
>
>--- "dios" <adiosadios@crosswinds.net>
>> wrote:
>>Hola guru's,
>>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
>
Bah! The one I just sent won't give you what you're looking for above. Shoulda read the output section again:
Select col1, col2
from table
where col1 in (select col1
from table
group by col1
order by col1
having count(col1) > 1)
Sorry.
carlos
==
Maintainer of the procrastinator's FAQ. Well, maybe tomorrow I will be.
_____________________________________________________________
Want a new web-based email account ? ---> http://www.firstlinux.net