Welcome to WebmasterWorld Guest from 23.22.140.143

Forum Moderators: open

Message Too Old, No Replies

need help in mysql query

     
3:09 am on Mar 22, 2010 (gmt 0)

New User

5+ Year Member

joined:Mar 22, 2010
posts:2
votes: 0


Hi all,
i have a table (sales) that contain cust_id, item_id and item_qty.
example:
cust_id item_id item_qty
abc 100 100
abc 110 100
abc 120 100
abb 100 100
abb 120 100
abb 130 100
aba 110 100
aba 120 100
aba 130 100

how to make query that give result: customer abb (who not buy item 110)

Thanks for any help/ idea
4:59 pm on Mar 22, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 9, 2003
posts:3416
votes: 0


Welcome to WebmasterWorld, plusnplus!

Is this what you're looking for?

SELECT *
FROM `sales`
WHERE `cust_id` = 'abb'
AND `item_id` != '110'