SQL comparing all values in a many-one table -
i have table follows
column1 column2 1 2 b 2
i need write sql query go through table , return me column 2 values have both , b in column 1.
try this:
select column2 mytable column1 in ('a', 'b') group column2 having count(distinct column1) = 2
Comments
Post a Comment