sql - Restrict column with multiple values not appear if one condition is also met -
so title might not make sense. here's trying do.
c1 c2 c3 a1 yes x1 a2 no x1 a3 maybe x1 a4 yes x2 so have condition c2 <>'no'. in case want result include
c1 c2 c3 a4 yes x2 appreciate folks!
use minus list of c3s don't have no c2. , select rows table.
select * table c3 in( select distinct c3 table minus select distinct table c2 = 'no' )
Comments
Post a Comment