0
This my query below serves to mount a table with data from multiple tables, however is giving an error:
Error Code: 1242. Subquery Returns more than 1 Row 0,000 sec
I think and the problem is in this sub-query:
(select tblCategoria.nomeCategoria as nomeCategoria
from tblAnimeHentai
inner join tblCategoria on tblAnimeHentai.categoria = tblCategoria.idCategoria) as categoria
I think it loads all categories instead of loading the corresponding.
select tblAnimeHentai.nomeAnime as nomeAnime
,tblAnimeHentai.descricaoAnime as descricaoAnime
,tblAnimeHentai.episodiosAnime as episodiosAnime
,tblAnimeHentai.tumbLocation as tumbLocation
,(select tblCategoria.nomeCategoria as nomeCategoria
from tblAnimeHentai
inner join tblCategoria on tblAnimeHentai.categoria = tblCategoria.idCategoria) as categoria
,tblAnimeHentai.completo as completo
,tblAnimeHentai.dataPublicacao as dataPublicacao
,tblAnimeHentai.dataAdicionado as dataAdicionado
,tblAnimeHentai.comentarioAnime as comentarioAnime
,tblAnimeHentai.produtora as produtora
from tblAnimeHentai;
What am I doing wrong? How can I correct the error?
Another question, as I would put a Where at the end of category, type Where category = "category x"
– igor3k
in the case, tblAnime.category is an int, I want to inform the category with text, type, tblAnime.category = 1, while tblCategoria.catgeoria = "category x", I want to select through the text generated with Join
– igor3k