|
-
This looks like homework but you are trying - we appreciate that.
1- Just one inline view would solve it; no need for two.
2- Since PK in both tables is (user_id, course_id, and start_date) chances are tables have more than one column with identical (user_id, course_id) values. Question is... which NEW_COURSES row should be choosen to update COURSES row? the one with the higher start_date?
3- Think about what should query do if for a give courses(user_id,course_id) there is no matching row on new_courses table.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|