zoukankan      html  css  js  c++  java
  • rszl数据表和crjsj数据表的关联查询

    '查找姓名为 '某某某' 或者 卡号为99999999 或者 编号为 '号号号' 的crjsj资料 和人事资料
    ;----------------------------------------------------------------------
    SELECT crjsj.id, rszl.bh, crjsj.kh, rszl.xm, crjsj.time8, crjsj.date8, crjsj.mjjbh, crjsj.mjkzqbh, crjsj.syqk, crjsj.crjqk
    FROM crjsj RIGHT JOIN rszl ON crjsj.kh = rszl.kh
    WHERE
     crjsj.kh=99999999
     or
     crjsj.kh=(select kh from rszl where xm='某某某' and dele=0)
     or
     crjsj.kh=(select kh from rszl where bh='号号号' and dele=0)

      and date8 between #2005-1-26# and #2005-7-26#
    ;----------------------------------------------------------------------
    select a.id,b.bh,a.kh,b.xm,a.date8,a.time8 from crjsj a,rszl b where
           a.kh=b.kh and
           (a.kh=1 or
            a.kh=(select top 1 kh from rszl where xm='某某某' and dele=0) or
            a.kh=(select top 1 kh from rszl where bh='号号号' and dele=0)
            ) and
           a.date8 between #2005-7-26# and #2005-7-26#
    ;----------------------------------------------------------------------

  • 相关阅读:
    搜索框用定时器限制发送请求
    vue的生命周期,钩子函数
    事件委托的实现流程
    在vscode中快速生成vue模板
    JS继承
    各种宽高
    ES6新特性
    python入门学习一
    字符编码
    npm install --save 与 npm install --save-dev 的区别
  • 原文地址:https://www.cnblogs.com/cnLiou/p/200984.html
Copyright © 2011-2022 走看看