How about this?
SELECT p.marker
FROM produto p
INNER JOIN laptops lap ON p.model = lap.model
WHERE lap.model = ?
Where ?
is the laptop model.
However, you might want to show various product and laptop fields:
SELECT p.marker, p.type, p.model, lap.preco, lap.ram, lap.outrocampo
FROM produto p
INNER JOIN laptops lap ON p.model = lap.model
WHERE lap.model = ?
However, if on the other hand you just want the model
and nothing else, then considering that the query does not bring any field of the table laptops
and that the code given to the laptop is the same as the table produto
, soon you could simplify to have it:
SELECT p.marker
FROM produto p
WHERE p.model = ?
Hi @William, you should use the
Inner Join
to join the tables, in this link has some information.– Marco Giovanni