oracle 中,多表查询和join查询在同一个from中是不混用的。以下语句是可以的:
select t.guide_id,t.staff_id,st.score from
(
select eg.guide_id,cfg.staff_id,cfg.exam_staff_id ,cfg.score_type
from exam_guide2 eg,staff_mark_config cfg,exam_table et
where eg.belong_exam_id=cfg.belong_exam_id and et.table_id=eg.belong_table_id
and cfg.score_type=12 and cfg.exam_staff_id='H00229' and et.table_id='258'
order by cfg.staff_id,eg.guide_id
) t
left join score_table2 st on
(t.guide_id=st.guide_id and t.staff_id=st.staff_id and t.exam_staff_id=st.exam_staff_id and t.score_type=st.exam_type)
但如果不分子查询,join部分,接在 exam_table et后面,就有问题了,oracle报莫名的非法字符。
1508

被折叠的 条评论
为什么被折叠?



