'查找姓名为 '某某某' 或者 卡号为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#
;----------------------------------------------------------------------

相关文章:

  • 2022-12-23
  • 2021-11-05
  • 2021-05-17
  • 2021-06-07
  • 2022-12-23
  • 2021-09-29
  • 2021-11-19
猜你喜欢
  • 2021-12-10
  • 2021-12-10
  • 2021-11-23
  • 2021-11-02
  • 2022-02-13
  • 2022-02-09
  • 2022-12-23
相关资源
相似解决方案