Wednesday, January 20, 2016

SQL NOT IN: Display Records That Are NOT IN Another Table

Let's say you want to display the records from the left table which is the ENROL table  which are NOT IN the right table which is the SUBMIT table.

Tables:
       

STUDENT
ENROL











Query:
select * from student where stud_id NOT IN (select stud_id from enrol)

The output displays records of students that are not yet enrolled.

Output:



SQL NOT IN: Display Records That Are NOT IN Another Table





SQL NOT IN: Display Records That Are NOT IN Another Table Rating: 4.5 Diposkan Oleh: Emoblazz

0 comments:

Post a Comment