I need to run the statement below but I am receiving the following error message:
Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
I know what the error is telling me (iti s returning more than one ponumber for the query). I need to know how I would run that and show me all ponumber that match the where clause.
select a.ponumber, a.itemnmbr, a.itemdesc, a.vendorid, a.unitcost, b.stndcost, b.currcost from
(select * from pop10110) A
(select * from iv00101) B
on a.itemnmbr = b.itemnmbr
where (a.unitcost > b.stndcost) or (a.unitcost = 0) and (ponumber=(select ponumber from pop10100 where postatus = '5'))
order by ponumber asc