sql - return row only if value not in other row -


have following subset of tblmember in access 2010:

mem_num               product_type           address     1                                           blah 1                          c                  blah 2                                           blah 2                          c                  blah 2                          d                  blah 3                                           blah 3                          b                  blah 4                                           blah 4                          c                  blah 

i want select rows product_type 'a', if mem_num not have product type 'b' in row or

mem_num               product_type          address 1                                           blah 2                                           blah 4                                           blah 

thanks!

you can try query

select * tblmember product_type = 'a'       , mem_num not in (select mem_num        tblmember product_type = 'b' ) 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -