File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes What is  In clause Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "What is  In clause" Watch "What is  In clause" New topic

What is In clause

Ranga Reddy shreya
Ranch Hand

Joined: Oct 20, 2004
Posts: 30
What is In clause in sql
difference between exist cluase and IN clause

Enjoy life .
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
Get the list of students that have secured good grades
SELECT from student s WHERE s.grade IN ('A','B','C')

Get the list of students that have secured good grades and are not in the badstudents list
SELECT from student s WHERE NOT EXISTS ( SELECT 1 FROM badstudents b where b.studentid = s.studentid) AND s.grade IN ('A','B','C')

MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
I agree. Here's the link:
subject: What is In clause
It's not a secret anymore!