October 28, 2014 at 3:23 am
HI FOlks,
I have problem with the below subquery and throwing this issue
(Select (BudgetHigh+BudgetLow) as Budget
from BDF_Form_Budget as fb
LEFT OUTER JOIN BDF_tlkp_BudgetType AS bt ON fb.BudgetTypeId=bt.BudgetTypeID
left outer join BDF_tlkpBudgetPlatform as pt on fb.PlatformId=pt.PlatformID
where FormId=b.FormID )as TotalBudget
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression
please help me out to solve this.
Thanks,
Frank
October 28, 2014 at 3:38 am
As the error says, the subquery returns more than one row, which is not permitted in that context. You'll need to change the subquery to ensure that it only ever returns a single row. Are you missing a SUM/GROUP BY perhaps?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 28, 2014 at 3:38 am
Based on what you posted, I suppose that you're not showing us all the code, but just a small portion of it.
Can you share the whole statement, please?
-- Gianluca Sartori
October 28, 2014 at 6:11 am
As GilaMonster states, in this subsquery it is returning more than one row which cannot happen, please show us the whole query or find a way through correlated subqueries or something to limit your query to one row only.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply