I'm not very experienced with SQL language, how could I make a query work this way:
SELECT *,
( SELECT marca.* FROM marca WHERE marca.id = produtos.id ) AS nome_marca
FROM produtos WHERE id = 5
What I want to return is all *
of table produtos
and all *
of table marca
saving in nome_marca
.
If I try to select only 1 field like so -> ( SELECT marca.nome FROM marca WHERE marca.id = produtos.id )
the code runs normal. But it does not spin if I try to select all with *