2
I’ll give you a simple example...
I have a table 'products' that has in the columns, id, product name, value. I have another table 'users' columns, id, name. And another table 'buysdosusuarios' id, id_user, id_produtos, nomedoproduto, this third table is generated from these first two... until then OK.
I want to search in the table 'products' all items except the items that have 'id_user'(from the shopping table)= 1 for ex
produtos
id nomedoproduto, valor
1 Roupa 100
2 Telefone 500
3 Geladeira 1500
4 TV 1000
5 Microondas 300
6 Sofá 600
users
id nome
1 José
2 Felipe
Compras dos usuários
id id_user id_produtos produtos
1 1 1 Roupa
2 1 2 Telefone
3 1 3 Geladeira
4 2 1 Roupa
Well... if the user has already bought... I want it not to appear on the list anymore. how do I use this with select?
You want all products that have not yet been purchased by anyone. That?
– Sorack
@Daneven use Join https://www.w3schools.com/sql/sql_join.asp to select two tables or more..
– Tmc
I recommend reading: Not IN or Not EXISTS which to use?
– Marconi
No, actually per user
– Dan Even