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 may want to show multiple 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 want only model
and nothing else, then considering that the query does not contain any fields of the laptops
table and that the code given to the laptop is the same as the produto
, you could soon simplify to have this:
SELECT p.marker
FROM produto p
WHERE p.model = ?