|
麻烦帮看看下面SQL有什么问题呀,我就是查不出来
select qs.code,
qs.cp_code,
qs.sc_code,
qs.score,
qs.degree,
qs.created,
qs.type_code,
qsLangDef.description AS questionDef,
qsLangSec.description AS questionSec,
cpLang.description AS chapter,
scLang.description AS section,
qsType.description AS type,
qsLangDef.language,
qs.id_question_lang,
qs.id_answer_lang,
asLangDef.description AS answerDef,
asLangSec.description AS answerSec
from question AS qs
inner join question_lang AS qsLangDef on
qs.id_question_lang = qsLangDef.id_question_lang
inner join question_lang AS qsLangSec on
qs.id_question_lang = qsLangSec.id_question_lang
inner join question_lang AS asLangDef on
qs.id_answer_lang = asLangDef.id_question_lang
inner join question_lang AS asLangSec on
asLangDef.id_question_lang = asLangSec.id_question_lang
and qsLangDef.language = asLangDef.language
inner join question_type AS qsType on
qs.type_code = qsType.code
and qsLangDef.language = qsType.language
inner join chapter AS cp on
qs.cp_code = cp.code
left outer join section AS sc on
qs.cp_code = sc.cp_code
and qs.sc_code = sc.seq
inner join common_lang AS cpLang on
cp.id_name_lang = cpLang.id_lang
and qsLangDef.language = cpLang.language
left outer join common_lang AS scLang on
sc.id_name_lang = scLang.id_lang
and qsLangDef.language = scLang.language
and cpLang.language = scLang.language
|
|