zoukankan      html  css  js  c++  java
  • union all 对结果进行分类展示

    SELECT ENT_ID,
           '共同债务人' TYPE_,
           '1' ORDER_,
           RESP_AMT_CO_DEBIT  RESP_AMT,
           BALANCE_CO_DEBIT BALANCE,
           FOCUS_BALANCE_CO_DEBIT FOCUS_BALANCE,
           BAD_BALANCE_CO_DEBIT BAD_BALANCE,
           RESP_AMT_CO_GUAR RESP_AMT_GUAR,
           BALANCE_CO_GUAR BALANCE_CO,
           FOCUS_BALANCE_CO_GUAR FOCUS_BALANCE_CO,
           BAD_BALANCE_CO_GUAR BAD_BALANCE_CO
      FROM V_ENT_REL_RESP_SUMMARY
     WHERE ENT_ID ='911100000000184548'
    UNION ALL
    SELECT ENT_ID,
           '保证人' TYPE_,
           '2' ORDER_,
           RESP_AMT_WAR_DEBIT RESP_AMT,
           BALANCE_WAR_DEBIT BALANCE,
           FOCUS_BALANCE_WAR_DEBIT FOCUS_BALANCE,
           BAD_BALANCE_WAR_DEBIT BAD_BALANCE,
           RESP_AMT_WAR_GUAR RESP_AMT_GUAR,
           BALANCE_WAR_GUAR BALANCE_CO,
           FOCUS_BALANCE_WAR_GUAR FOCUS_BALANCE_CO,
           BAD_BALANCE_WAR_GUAR BAD_BALANCE_CO
      FROM V_ENT_REL_RESP_SUMMARY
     WHERE ENT_ID ='911100000000184548'
    UNION ALL
    SELECT ENT_ID,
           '其他' TYPE_,
           '3' ORDER_,
           RESP_AMT_ELSE_DEBIT RESP_AMT,
           BALANCE_ELSE_DEBIT BALANCE,
           FOCUS_BALANCE_ELSE_DEBIT FOCUS_BALANCE,
           BAD_BALANCE_ELSE_DEBIT BAD_BALANCE,
           RESP_AMT_ELSE_GUAR RESP_AMT_GUAR,
           BALANCE_ELSE_GUAR BALANCE_CO,
           FOCUS_BALANCE_ELSE_GUAR FOCUS_BALANCE_CO,
           BAD_BALANCE_ELSE_GUAR BAD_BALANCE_CO
      FROM V_ENT_REL_RESP_SUMMARY
     WHERE ENT_ID ='911100000000184548'
    UNION ALL
    SELECT ENT_ID,
           '合计' TYPE_,
           '4' ORDER_,
           RESP_AMT_SUM_DEBIT RESP_AMT,
           BALANCE_SUM_DEBIT BALANCE,
           FOCUS_BALANCE_SUM_DEBIT FOCUS_BALANCE,
           BAD_BALANCE_SUM_DEBIT BAD_BALANCE,
           RESP_AMT_SUM_GUAR RESP_AMT_GUAR,
           BALANCE_SUM_GUAR BALANCE_CO,
           FOCUS_BALANCE_SUM_GUAR FOCUS_BALANCE_CO,
           BAD_BALANCE_SUM_GUAR BAD_BALANCE_CO
      FROM V_ENT_REL_RESP_SUMMARY
     WHERE ENT_ID = '911100000000184548'
     ORDER BY ORDER_

    对结果进行分类展示

  • 相关阅读:
    第八次作业
    设计一款给爸爸妈妈用的手机
    第五次作业
    第四次作业(项目分析)
    第二次作业(个人项目实践)
    即时通讯软件的发展演变
    C++用法的学习心得
    JavaScript(变量、作用域和内存问题)
    一、Java和JavaScript
    使用Hyper-V创建虚拟机
  • 原文地址:https://www.cnblogs.com/smile502/p/13473917.html
Copyright © 2011-2022 走看看