MySQL Forums
Forum List  »  Portuguese

Subconsulta retorna mais que 1 registro
Posted by: Douglas dfoliveira
Date: December 02, 2020 06:08AM

Bom dia, estou tentando executar o script abaixo mas está dando a mensagem: "Subconsulta retorna mais que 1 registro"

Existe uma forma de contornar essa mensagem?


SELECT
prod.virtuemart_product_id AS 'IDdoProduto',
prod.product_name AS 'Nome do Produto',
med.virtuemart_media_id AS 'ID da imagem',

(SELECT
md.virtuemart_product_id
FROM
b4tds_virtuemart_product_medias AS md) AS 'idproduto',
(SELECT
md.virtuemart_media_id
FROM
b4tds_virtuemart_product_medias AS md) AS 'IDdaimagem',
(SELECT
imge.file_title
FROM
b4tds_virtuemart_product_medias AS md
LEFT JOIN b4tds_virtuemart_medias AS imge ON imge.virtuemart_media_id = md.virtuemart_media_id) AS 'Nomedoarquivo'

FROM
b4tds_virtuemart_products_pt_br AS prod
LEFT JOIN b4tds_virtuemart_product_medias AS med ON med.virtuemart_product_id = prod.virtuemart_product_id
WHERE
prod.virtuemart_product_id <> 0
ORDER BY IDdoProduto DESC
Limit 1000;

Options: ReplyQuote


Subject
Views
Written By
Posted
Subconsulta retorna mais que 1 registro
137
December 02, 2020 06:08AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.