我创建了一个查询,以从表的列中获取通过该查询不为空的值:
Select * from(
SELECT OEID, Chest_Pain as Head, Chest_PainComment as Detail
FROM tblComplaints
union
SELECT OEID, SOB as Head, SOBComment as Detail
FROM tblComplaints
union
SELECT OEID, PND as Head, Cyanosis as Detail FROM tblComplaints
union
SELECT OEID, Odema_Feet as Head, Vertigo + as Detail From tblComplaints
union
SELECT OEID, DM as Head, DMComment as Detail
FROM tblComplaints
union
SELECT OEID, RS as Head, RSComment as Detail
FROM tblComplaints
) as t
where (Head is not null and ltrim(rtrim(Head)) …Run Code Online (Sandbox Code Playgroud)