Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, = or when the subquery is used as an expression.

$
0
0

IF (
select  COUNT(*) AS COUNT  from(select distinct SUBSTRING(LandRiverSegment,7,19) as riverseg,CBSegid from wsmpv24Reporting.dbo.TblLandRiverSegment
) as a
group by riverseg
having COUNT(*)>1)>1---check if more than Cbsegid are found ..if yes error if no update

when i run this individually it is showing the count ,---2

but when this part is kept in a Cursor it throws eror 
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

can any one please help me

Thanks


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>