Can someone give me an example a query I would need in order to accomplish the following, I would like it in a single query if possible.
I have 2 tables: itemsforsale and itemsbought
When the user visits the page I want only to display products from itemsforsale that the user has not purchased already, doesn't exist in itemsbought.
So something like
Code: Select all
SELECT items FROM itemsforsale WHERE item-with-same-item DOES NOT EXIST in itemsbought WHERE user_id = user and item_id = itemsforsaleid