- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
SELECT
lmd.Name AS DisciplineName,
lmdv.ModDiscipVersionID,
lmn.Name AS ModuleName,
lm.ModuleID
FROM StudyContract sc
INNER JOIN PersonalLesson pl
ON sc.StudyContractID = pl.StudyContractID
INNER JOIN lst_Module lm
ON pl.ModuleID = lm.ModuleID
INNER JOIN lst_ModuleName lmn
ON lm.ModuleNameID = lmn.ModuleNameID
INNER JOIN lst_ModDiscipVersion lmdv
ON lm.ModDiscipVersionID = lmdv.ModDiscipVersionID
INNER JOIN lst_ModDiscip lmd
ON lmdv.ModDiscipID = lmd.ModDiscipID
INNER JOIN Student s
ON sc.StudentID = s.StudentID
INNER JOIN TrainingProduct_Lesson tpl
ON tpl.PersonalLessonID = pl.PersonalLessonID
INNER JOIN TrainingProduct tp
ON tp.TPID = tpl.TPID
WHERE sc.ContractNumber = '050000000000'
AND s.Surname = 'к'
AND
(
tp.TPKindID=1 OR
tp.TPKindID=3 OR
tp.TPKindID=8 OR
tp.TPKindID=12 OR
tp.TPKindID=15 OR
tp.TPKindID=52 OR
tp.TPKindID=58 OR
tp.TPKindID=94 OR
tp.TPKindID=6 OR
tp.TPKindID=39 OR
tp.TPKindID=80 OR
tp.TPKindID=40 OR
tp.TPKindID=74 OR
tp.TPKindID=17 OR
tp.TPKindID=33
)
GROUP BY lmd.Name,lmdv.ModDiscipVersionID,lmn.Name,lm.ModuleID
Говнокодеры Современной Гуманитарной Академии не подозревают о такой вещи как tp.TPKindID IN (1;3;...;33)