У меня есть сложный оператор select в моем запросе, который я использую три раза, для внешних соединений. Я хотел бы, чтобы упростить его использовать сложный запрос один раз, но это не работает:Полное внешнее соединение с одной выбранной таблицей
select three.faculty, three.chair, one.students honors,
two.students normal, three.students bad
from [complex select statement] one
full outer join
select * from (one) two
on one.faculty=two.faculty and one.chair=two.chair and one.n=two.n
full outer join
select * from (one) three
on two.chair=three.chair and two.faculty=three.faculty and two.n=three.n
версия с использованием сложного запроса неоднократно работы:
select three.faculty, three.chair,one.students honors,
two.students normal, three.students bad
from [complex select statement] one
full outer join
select * from [complex select statement] two
on one.faculty=two.faculty and one.chair=two.chair and one.n=two.n
full outer join
select * from [complex select statement] three
on two.chair=three.chair and two.faculty=three.faculty and two.n=three.n
как сделать его одним выбором с базы и другим выбором с первого –