Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is In clause

 
Ranga Reddy shreya
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is In clause in sql
difference between exist cluase and IN clause
 
Richard Green
Ranch Hand
Posts: 536
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get the list of students that have secured good grades
SELECT s.name 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 s.name from student s WHERE NOT EXISTS ( SELECT 1 FROM badstudents b where b.studentid = s.studentid) AND s.grade IN ('A','B','C')
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic