Hello Igor,

sorry, i was too fast. The following does it:

create table mytable (a string, b string);

insert into mytable (a,b) values ('Joe', 'Smith');
insert into mytable (a,b) values ('Ann', 'Smith');
insert into mytable (a,b) values ('Fred', 'Miller');

select * from mytable where b in
 (
select b
from mytable
group by b
having count(b) > 1
)


Igor Tandetnik wrote:
> Martin Engelschalk
> <[EMAIL PROTECTED]> wrote:
>   
>> Hi,
>>
>> let the table have two columns, "a" and "b". Then
>>
>> select a, count(b)
>> from yourtable
>> group by a
>> having count(b) > 1
>>
>> returns 'fred' and 'roger'.
>>     
>
> No it doesn't. It returns an empty set. Try it.
>
> Igor Tandetnik 
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to