sql 获取NA类别的问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 获取NA类别的问题相关的知识,希望对你有一定的参考价值。

SELECT DISTINCT qm.QuestionId	
	--,qm.QuestionCategoryId
	,qc.QuestionCategory
	,s.SkillName
	,p.NAME AS PGU
FROM dbo.UserAssessmentQuestion uaq
INNER JOIN dbo.Assessment a ON uaq.AssessmentId = a.AssessmentId
	AND a.WaveId IN (
		100
		,103
		)
INNER JOIN dbo.QuestionMaster qm ON uaq.QuestionId = qm.QuestionId
	AND qm.IsActive = 1
	AND qm.IsReviewed = 1
	AND qm.CurrentLevelId = 5
INNER JOIN dbo.QuestionCategories qc ON qm.QuestionCategoryId = qc.QuestionCategoryId
	AND (
		qc.QuestionCategory = 'NA'
		OR qc.QuestionCategory = 'N/A'
		OR qc.QuestionCategory = 'Not Applicable'
		OR qc.QuestionCategory = 'QuestionC_01'
		OR qc.QuestionCategory = 'QuestionC_02'
		OR qc.QuestionCategory = 'Default'
		)
INNER JOIN dbo.Skill s ON qm.SkillId = s.SkillId
INNER JOIN dbo.PGU p ON qm.PGUId = p.PGUId
LEFT JOIN dbo.Wave w ON a.WaveId = w.Id
ORDER BY qm.QuestionId

以上是关于sql 获取NA类别的问题的主要内容,如果未能解决你的问题,请参考以下文章

SQL 如何获取不包含产品的类别?

获取特定子记录的 SQL 查询

如何通过 DB (SQL) 获取 Wordpress 类别 (the_categories())

sql 按类别和标签获取帖子

SQL Server:SELECT 查询以获取 DISTINCT 和 MAX 显示顺序值

获取满足条件的直接父级的 SQL 查询