-1
The column I’m adding to subquery has more than one record, but do not know how to solve:
select productid,pb.pricebookid,(select bookname from vtiger_pricebook p
inner join vtiger_pricebookproductrel pbp
on p.pricebookid = pbp.pricebookid
where pbp.pricebookid = '299182') Wx
from vtiger_pricebookproductrel pbp
join vtiger_pricebook pb
ON pb.pricebookid = pbp.pricebookid
Putting a limit
of 1, it returns a repeat result because I used limit 1
just to see if it would return. Other than that it says that there is an error because I have more than one record in my subquery:
I want you to come back:
But I can’t get it all back because mine subquery returns more than one record.
How do I get my subquery to return more than one record?
Without knowing the structure of your bank is difficult.
– DaviAragao
I’ll edit it to make it clearer
– Gladiador
Why use subquery in such a case instead of a JOIN? It is important to [Edit] and reduce the problem to a [mcve], and give an example of what the dataset is like, what you want and how the result should be
– Bacco