Subqueries That Return Multiple Results
SQL>
SQL> CREATE TABLE Course (
2 CourseID INT NOT NULL PRIMARY KEY,
3 Name VARCHAR(50),
4 Credits INT);
SQL>
SQL>
SQL> CREATE TABLE Exam (
2 ExamID INT NOT NULL PRIMARY KEY,
3 CourseID INT NOT NULL,
4 InstructorID INT NOT NULL,
5 SustainedOn DATE,
6 Comments VARCHAR(255));
SQL>
SQL> SELECT Name FROM Course
2 WHERE CourseID IN(
3 SELECT CourseID from EXAM
4 WHERE SustainedOn='26-MAR-03'
5 );
no rows selected
SQL>
SQL> drop table course;
Table dropped.
SQL> drop table exam;
Table dropped.
Related examples in the same category