zoukankan      html  css  js  c++  java
  • sql left join on

    select sysuser.userid,
           sysuser.groupid,
           sysuser.sysid,
           nvl( userjd.mc,nvl(useryy.mc,usergys.mc)) sysmc
      from sysuser
      left join userjd on sysuser.sysid = userjd.id
      left join useryy on sysuser.sysid = useryy.id
      left join usergys on sysuser.sysid = usergys.id

     select SYSUSER.id,
             SYSUSER.userid,
             SYSUSER.username,
             SYSUSER.groupid,
             SYSUSER.sysid,
             decode(SYSUSER.Groupid,
                    '1',
                    (select mc from userjd where id = sysuser.sysid),
                    '2',
                    (select mc from userjd where id = sysuser.sysid),
                    '3',
                    (select mc from useryy where id = sysuser.sysid),
                    '4',
                    (select mc from usergys where id = sysuser.sysid)
                    ) sysmc
           
              from SYSUSER

  • 相关阅读:
    Linux排序命令sort笔记
    Linux排序命令sort笔记
    Linux文本截取命令cut​笔记
    排序和搜索
    栈和队列
    链表
    顺序表
    Linux编辑器|gedit|vi|vim编辑器
    Linux简介
    简单学习Git
  • 原文地址:https://www.cnblogs.com/justuntil/p/5661847.html
Copyright © 2011-2022 走看看