我有这个查询来从我的数据库中获取结果。我的问题是selectedanswer
select 语句的一部分并没有从中提取所有数据r.textboxmulti
。
以下是我的查询。
<cfquery name="fullResults" datasource="#variables.dsn#">
select s.id, s.name surveyname, q.question, subq.answer subquestion, isnull(isnull(isnull(isnull(a.answer, **r.textboxmulti**),r.other),r.textbox),r.truefalse) as **selectedanswer**, a.*, r.*
from results r
join questions q on r.questionidfk = q.id
left join answers subq on r.itemidfk = subq.id
left join answers a on r.answeridfk = a.id
join surveys s on q.surveyidfk = s.id
where owneridfk = <cfqueryparam value="#arguments.ownerid#" cfsqltype="CF_SQL_VARCHAR" maxlength="35">
order by s.id, owneridfk, q.rank, subq.rank desc
</cfquery