I need a query which will select that group which have not even a single PrimaryFlag='y'
Code: Select all
tbl_images
------------------------------------------------------------
imgID ProductID ImageFile PrimaryFlag
------------------------------------------------------------
1 1 a n
2 1 b n
3 1 c y
4 2 d n
5 2 e n
6 2 f n
7 3 g y
8 3 h n
9 3 i n
---------------------------------------------------The result should be like below.
Code: Select all
------------------------------------------------------------
imgID ProductID ImageFile PrimaryFlag
------------------------------------------------------------
4 2 d n
5 2 e n
6 2 f n
------------------------------------------------------------regards
Waqas