On Thu, Jul 29, 2010 at 00:47, Igor Tandetnik <itandet...@mvps.org> wrote: > Peng Yu <pengyu...@gmail.com> wrote: >> I want to select only the rows where if S column are the same, R1 >> column is the same and R2 column is the same. > > select * from mytable where s in > (select s from mytable > group by s > having min(r1)=max(r1) and min(r2)=max(r2) > );
Another possibility: having count(distinct r1) = 1 and count(distinct r2) = 1 -- Benoit Mortgat 20, avenue Marcel Paul 69200 Vénissieux, France +33 6 17 15 41 58 +33 4 27 11 61 23 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users