0
This query is giving error:
select c.* from carrinho_de_compras as cc
inner join clientes as c
on c.codigo = cc.cod_cliente
inner join produtos as p
on p.codigo = cc.cod_produto
where (select count(produtos.codigo) from produtos)
não entendo bem essa lógica das sub-consultas. Alguém pode me explicar?
What a mistake this consultation made?
– Woss
ERROR: argument of WHERE must be type Boolean, not type bigint LINE 6: Where (select Count(products.code) from products)
– Salguod
where (select count(produtos.codigo) from produtos)
can explain to us what you tried to do on that line?– Woss
list the quantity of products inserted
– Salguod
Within the
where
?– Woss
yes, I tried to do a sub query there. The plan was to list the amount of products of each customer and then show which customer bought more.
– Salguod
The
where
is to make logical expressions, conditions, can not be used so... would have to be something likewhere campo < (select ....)
. That oneselect
should be in thefrom
– Ricardo Pontual
I understand I’ll change here, thank you
– Salguod