Я получаю сообщение об ошибке - «Не удалось запустить транзакцию;слишком много транзакций уже вложено.когда я использую 7 операторов объединения для запроса.Если я удаляю один оператор объединения и делаю его 6, тогда все работает отлично.Любая помощь в решении этой проблемы будет очень ценной.
Спасибо!
Используемые мной таблицы:
School_TBL состоит из столбца курсов и столбца студентов.Один студент может пройти больше курса (так что это многозначное поле)
Вот оператор SQL:
select 'John' as Student Name, Sum(IIf([CourseID]=1,1,0)) as Math, Sum(IIf([CourseID]=2,1,0)) AS English
From School_TBL
where (School_TBL.StudentID.value = 2 and School_TBL.CourseID.Value=1)
GROUP BY School_TBL.StudentID.Value
UNION ALL
select 'Jane' as Student Name, Sum(IIf([CourseID]=1,1,0)) as Math, Sum(IIf([CourseID]=2,1,0)) AS English
From School_TBL
where (School_TBL.StudentID.value = 3 and School_TBL.CourseID.Value=1)
GROUP BY School_TBL.StudentID.Value
UNION ALL
select 'Jim' as Student Name, Sum(IIf([CourseID]=1,1,0)) as Math, Sum(IIf([CourseID]=2,1,0)) AS English
From School_TBL
where (School_TBL.StudentID.value = 4 and School_TBL.CourseID.Value=1)
GROUP BY School_TBL.StudentID.Value
UNION ALL
select 'Hank' as Student Name, Sum(IIf([CourseID]=1,1,0)) as Math, Sum(IIf([CourseID]=2,1,0)) AS English
From School_TBL
where (School_TBL.StudentID.value = 5 and School_TBL.CourseID.Value=1)
GROUP BY School_TBL.StudentID.Value
UNION ALL
select 'Jay' as Student Name, Sum(IIf([CourseID]=1,1,0)) as Math, Sum(IIf([CourseID]=2,1,0)) AS English
From School_TBL
where (School_TBL.StudentID.value = 6 and School_TBL.CourseID.Value=1)
GROUP BY School_TBL.StudentID.Value
UNION ALL
select 'Anna' as Student Name, Sum(IIf([CourseID]=1,1,0)) as Math, Sum(IIf([CourseID]=2,1,0)) AS English
From School_TBL
where (School_TBL.StudentID.value = 7 and School_TBL.CourseID.Value=1)
GROUP BY School_TBL.StudentID.Value
UNION ALL
select 'Amy' as Student Name, Sum(IIf([CourseID]=1,1,0)) as Math, Sum(IIf([CourseID]=2,1,0)) AS English
From School_TBL
where (School_TBL.StudentID.value = 8 and School_TBL.CourseID.Value=1)
GROUP BY School_TBL.StudentID.Value
UNION ALL
select 'Jason' as Student Name, Sum(IIf([CourseID]=1,1,0)) as Math, Sum(IIf([CourseID]=2,1,0)) AS English
From School_TBL
where (School_TBL.StudentID.value = 9 and School_TBL.CourseID.Value=1)
GROUP BY School_TBL.StudentID.Value