备注 | 修改日期 | 修改人 |
其他原因...增加方法二 | 2023-03-23 13:54:06[当前版本] | 系统管理员 |
CREAT | 2023-03-23 11:45:05 | 系统管理员 |
select (select BraCode as 'td' for xml path(''), type), (select BraName as 'td' for xml path(''), type), (select BraPrefix as 'td' for xml path(''), type) from Bra_Mst for xml path('tr')
效果
<tr> <td>HKG</td> <td>Hong Kong</td> <td>HKG</td> </tr> <tr> <td>SHA</td> <td>Shanghai</td> <td>SHA</td> </tr>
select (select 'Problem' as th for xml path(''), type), (select 'Onset' as th for xml path(''), type), (select 'Status' as th for xml path(''), type) union all select (select p.ProblemType as 'td' for xml path(''), type), (select p.Onset as 'td' for xml path(''), type), (select p.DiagnosisStatus as 'td' for xml path(''), type) from tblProblemList p where p.PatientUnitNumber = @PatientUnitNumber for xml path('tr')