This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in query  RSS feed

 
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
Boost this thread!