|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using exists operator
I have to use an exists operator to list the course code and title for all courses for which there is someone with qualifications.
SELECT course.course_code, course.course_title FROM DB519S.course WHERE exists (SELECT course_code FROM DB519S.expertise); The code above is returning too many course_codes. What am I doing wrong? |
|
#2
|
|||
|
|||
|
Code:
SELECT course.course_code, course.course_title FROM DB519S.course WHERE course_code in (SELECT course_code FROM DB519S.expertise); |
|
#3
|
|||
|
|||
|
Thanks for the code but the task was to use exists
I think I got it working Code:
SELECT c.course_code, c.course_title FROM DB519S.course c WHERE EXISTS (SELECT e.course_code FROM DB519S.expertise WHERE c.employee_id = e.employee_id) I know I didn't give the employee_id before but I never thought to use it in the query. Thanks for your suggestion though! |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Using exists operator |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|