hi,
Can anyone tell why i am getting this error, At most one record can be returned by this subquery.
My query is,
"SELECT Count(*) AS TotalComp,(SELECT Count(*) FROM DE INNER JOIN CmpMaster ON DE.DE_Id = CmpMaster.DE_Id WHERE CmpMaster.Order='Yes' OR IsRegistered='True' AND DEO.District LIKE '" + dist + "%' GROUP BY DE.District ) AS TOTALORDER FROM DE INNER JOIN CmpMaster ON DE.DE_Id = SchCmpMaster.DE_Id WHERE (((DE.District) Like '" + dist + "%'))GROUP BY DE.District "
i am looping this qurey for different district, for first dist it work fine and on 2nd onward it throws the error.
please provide some alternate for this.
Regards,
yash
Error: At most one record can be returned by this subquery
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Hirendra SisodiyaRank #258 · 9.8K reputationPosted Jul 23, 2010, 3:28 AM EDT
your problem is very common..check that subquery should return atleast one record....
thanks