次のように私は、pgAdminで2つのサブクエリ(v1.20.0)に参加しようとしています:SQLで2つの条件付きサブクエリを結合するにはどうすればよいですか?
select * from (
select distinct course_code "400-Level Courses", meet_time_start "Starting Time", meet_time_end "End Time", meet_day_of_week "Day", building_code "Building", building_room_no "Room"
from faculty_course_credit
left join course_schedule using (term_id, course_code, course_ref_no)
where (substring(course_code,4,1) = '4') and meet_time_start != '00:00'
)
inner join (
select * from (
select distinct course_code "500-Level Courses", meet_time_start "Starting Time", meet_time_end "End Time", meet_day_of_week "Day", building_code "Building", building_room_no "Room"
from faculty_course_credit
left join course_schedule using (term_id, course_code, course_ref_no)
where (substring(course_code,4,1) = '5') and meet_time_start != '00:00'
))
using (building_code=building_code, building_room_no=building_room_no, meet_time_start=meet_time_start, meet_time_end=meet_time_end, meet_day_of_week=meet_day_of_week)
私はスキーマ内の表を作成する権限を持っていない、と私は次のエラーメッセージを取得しておいてください。
ERROR: subquery in FROM must have an alias LINE 1: select * from ( ^HINT: For example, FROM (SELECT ...) [AS] foo. ********** Error **********
ERROR: subquery in FROM must have an alias SQL state: 42601 Hint: For example, FROM (SELECT ...) [AS] foo. Character: 16
いずれかの提案がありますか?