Subqueries That Return Multiple Results : Multiple Row Subquery « Query Select « Oracle PL/SQL Tutorial






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.








2.38.Multiple Row Subquery
2.38.1.Writing Multiple Row Subqueries
2.38.2.Using IN with a Multiple Row Subquery
2.38.3.Update price of products that aren't selling
2.38.4.Multi-row subqueries: Show products that aren't selling
2.38.5.Uses NOT IN to check if an id is not in the list of id values in the employee table
2.38.6.Using ANY with a Multiple Row Subquery
2.38.7.Using ALL with a Multiple Row Subquery
2.38.8.Writing Multiple Column Subqueries
2.38.9.Select from another select statement
2.38.10.Subqueries That Return Multiple Results
2.38.11.First three rows from subquery