sql查询

来源:互联网 发布:1394mac 编辑:程序博客网 时间:2024/04/30 02:54



select seri, max(case when insunit='℃' then hvalue end) as tvalue,max(case when insunit='%' then hvalue end) as hvalue from (SELECT substring(insname,1,(CHARINDEX('#',insname)-1)) as seri,insunit,hvalue  from JfDevIns where devid=56 and insunit is not null )as tb group by seri