Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Error getting in Subquery

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-01-11 : 08:11:00
Suprita writes "Hi!

I am creating view for retrieving the data and that view transforming into another view for that i am getting error.

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

If i am giving the condition like RS.PK_INSTANCE_ID = 6 on that case i am getting the value, but if i am removing it, i am getting above error.

Help me out for that.

Thanks"

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2006-01-11 : 08:21:50
can u please post some code so that some one can look into it...

when u specify and "=" it expects a single value for comparision, but if u use a subquery for comparision, and if it returns more than one value then it will give u above error.




-----------------



http://www.sqljunkies.com/weblog/sqldude
http://harshals.blogspot.com
Go to Top of Page

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2006-01-11 : 08:31:54
When u expect more than one value the u shud keep the subquery in an "In" Clause.

select * from students_marks
where
student Id in (Select student id in Student_master)

Regards
Sachin


Don't sit back because of failure. It will come back to check if you still available. -- Binu
Go to Top of Page
   

- Advertisement -