日期:2014-05-17 浏览次数:20476 次
select *from ((select DrawingID,VoteName,DrawingName,ActivityName,DrawingTime
from tblVOTEDrawingInfo a left join tblVOTEActivityInfo b on a.ActivityID = b.ActivityID
left join tblVOTEVoteItem c on a.Type = c.VoteID
where Type in (select distinct VoteID from tblVOTEVoteItem))
union
(select DrawingID,QuestionnaireName as Name ,DrawingName,ActivityName,DrawingTime
from tblVOTEDrawingInfo d left join tblVOTEActivityInfo e on d.ActivityID = e.ActivityID
left join tblVOTEQuestionnaireInfo f on d.Type = f.QuestionnaireID
where Type in (select distinct QuestionnaireID from tblVOTEQuestionnaireInfo)))
tblVOTEActivityInfo where 1=1 and a.ActivityID='111111'