4
I have 2 tables:
paginas
and paginas_categorias
On the table paginas
I have a column called id_categoria
, which would be the corresponding id of the table paginas_categorias
. Using this id, I wanted to return the column nome
table paginas_categorias
.
I will try to give another example: my goal is that in this query:
SELECT id_paginas FROM paginas
return the value nome
table paginas_categorias
:
SELECT nome FROM paginas_categorias WHERE id = (id informado na outra tabela)
I saw that this would be a subquery, but I couldn’t use the examples with my reality.
You need to use a Join to merge tables.
– Marcelo Aymone