mysql - SQL statement for join but not in other table -
i have 2 tables: customer , mailing :
+==========+ +=============+ | customer | | mailing | +==========+ +=============+ | id | | id | +----------+ +-------------+ | name | | customer_id | +----------+ +-------------+ | mailing_id | +-------------+ every time send mailing customer, add row in mailings table mailing id. 1 mailing can sent multiple customers.
i want have sql call returns customers have not yet received mailing. how ?
i using mysql
select * customer id not in ( select customer_id mailing mailing_id = @mailing_id )
Comments
Post a Comment