• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is In clause

 
Ranga Reddy shreya
Ranch Hand
Posts: 30
  • 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
  • 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')
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!