3
可能是一个简单的,有没有办法快速转置我的数据,以便它读取而不是按行读取。如何将行转换为列?
以上是电流输出,但希望它跨越例如读取
AttendanceNumber, ExamDate, ExamCode1, ExamCode2, ExamCode3, .......ExamCode20
我的SQL是
SELECT [AttendanceNumber]
,[ExaminationDate]
,[ExamExaminationCode]
FROM [Radiotherapy].[dbo].[tblRadiologyData] rd
where rd.ExaminationDate >= '01 april 2016'
and rd.AttendanceSiteCode IN('CNM','RNM')
ORDER BY rd.LocalPatientIdentifier, rd.ExaminationDate
Wow work great,so now I have my data,there is possible to show the number of combinations and a count(例如, ExamCode1,ExamCode2组合发生x次。 – Simon
@Simon我不知道我明白你的需要..你是什么意思的组合? – sagi
它的好解决了它,但没有办法排列顺序考虑日期是相同的每个出席号码,所以每次我运行它它给了我不同的输出! – Simon