编写中。。。
select date(xtsj) as date,xtsj,xtsz,xtbz,sjd,
case when xtsz<>'' and xtsz is not null then
case when sjd like '%后' then
case when xtsj>CHGXT then '高'
when xtsz<CHDXT then '低'
else '正常' end
else
case when xtsj>CQGXT then '高'
when xtsz<CQDXT then '低'
else '正常' end
end
else
case when xtbz='HIGH' then '高'
when xtbz='LOW' then '低'
else '' end
end as '判断血糖颜色类型'
from xtsj,(select CQGXT,CQDXT,CHGXT,CHDXT from YHSZ ) as t order by xtsj desc