MS SQL数据库通过时间筛选,多行数据通过列显示

MS SQL数据库通过时间筛选查询。多行数据通过列显示数据:

数据库表:
图片说明

最后查询出表格式:

图片说明

查询语句怎么修改:
select * from ABCD where POINTTIME<='2018-10-11 00:00' and POINTTIME>='2018-10-10 00:00

select ABCD.时间,
        sum(case ABCD.变量名 when 'A' then ABCD.数据 else 0 end),
        sum(case ABCD.变量名 when 'B' then ABCD.数据 else 0 end),
        sum(case ABCD.变量名 when 'C' then ABCD.数据 else 0 end),
   from ABCD
  where POINTTIME <= '2018-10-11 00:00'
    and POINTTIME >= '2018-10-10 00:00'

有if函数没有?有的话,把decode换成if不就行了?