Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in query

 
Ram Mohan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai friends,

I am not geting a proper query for executing the following. can anyone help me.

I have two tables book and usershelf

the columns in the tables are following:

book : bid
usershelf:uid,bid

i have to retrieve bid from book such that this bid is not appeared in usershelf for a particular user(uid).

select b.bid from book b where b.bid!=(select u.bid from usershelf u where uid='u1')

but the above query returns more than one value for sub query.

So some one help me......

Ram Mohan
 
Sri Ram
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Y use "!=" in place of NOT IN.
Your query should be like
 
Ram Mohan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you

It works out.

Ram Mohan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic