1
Answer

Error: At most one record can be returned by this subquery

yashvant k

yashvant k

14y
1.9k
1
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

Answers (1)