qq_43294607
TTTTTHY
2018-12-10 06:16

此SQL的优化以及如何将查询结果分两列展示

  • 优化
  • sql

请问如何将此sql语句优化以及如何将查询结果分两列展示?

select COUNT(*) as "服务剩余总次数" from ACCT_PACKAGE_CUSTOMER  where USED_FLAG = 'N'and BR_UUID = '000000004e4c85a5014e4da389a4013d' and APC_STATUS = 'closeAccount'and APC_TYPE = 'servAndParts' UNION select COUNT(*) as "配件剩余总次数" from ACCT_PACKAGE_CUSTOMER  where USED_FLAG = 'N'and BR_UUID = '000000004e4c85a5014e4da389a4013d' and APC_STATUS = 'closeAccount'and APC_TYPE = 'service';

图片说明

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答