zoukankan      html  css  js  c++  java
  • 精典SQL语句

    1.两表全成一表
    select * from (select dwbm,xqid,dwmc,dwbz,xtbz,pxxh from xt_xqdwb  union (select xqid,1,xqmc,'0',null,null from xt_xq)) a where a.dwbm>'0' and a.xqid='1' and a.dwbz='0'  order by a.pxxh

    select id,   (select dwmc  from xt_xqdwb   where dwbm = finance_jsyfbx.bmbm    and xqid = '1'  and dwbz = '0') as bmbmmc,
               bmbm,
           zs,
           yfze,
           to_char(bxrq, 'yyyy-mm-dd') as bxrq
      from finance_jsyfbx
     where (tjid, id) in
           (select tjid, min(id) from finance_jsyfbx group by tjid) and bmbm='1'
     order by id desc
    select * from ((select to_char(dwbm),xqid,dwmc,dwbz,xtbz,pxxh from xt_xqdwb where dwbm>0) union (select 'XQ'||xqid,1,xqmc,'0',null,null from xt_xq where xqid>0)) a where a.xqid='1' and a.dwbz='0' order by a.pxxh

    2.字段合并
    select gwid,gwmc, gwmc||(case when (select dwmc from xt_xqdwb where dwbm = ssxt)='----全部----' then '' else '--------'||(select dwmc from xt_xqdwb where dwbm = ssxt) end)  as dwmc  from xt_gwbmb order by gwid
  • 相关阅读:
    Vue购物车项目
    总结前端面试过程中最容易出现的问题
    Node.js
    浏览器前端优化
    计算机课程
    谈谈对前端的理解
    MySQL
    阿里云Centos+Django+Nginx+uWSGI
    Windows + Apache + WSGI 部署Django
    Django积木块11 —— 缓存
  • 原文地址:https://www.cnblogs.com/draeag/p/895945.html
Copyright © 2011-2022 走看看