当前位置:Gxlcms > mysql > Oracle连接查询和sql语句中的条件判断

Oracle连接查询和sql语句中的条件判断

时间:2021-07-01 10:21:17 帮助过:16人阅读

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入 SELECT 1 UPLOAD, 0 SHENGJI, MR.BUSI_ID, MASTER.PERSON_ID, MASTER.ACNT_ID, MASTER.ID_NUM, MASTER.NAME, MASTER.SEX, MR.MIGRT_OUT_REGION, MR.OUT_OPERA_TIME, MR.OUT_OPERA_ID, MR.IN_OPERA_T

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入

  SELECT 1 UPLOAD,

  0 SHENGJI,

  MR.BUSI_ID,

  MASTER.PERSON_ID,

  MASTER.ACNT_ID,

  MASTER.ID_NUM,

  MASTER.NAME,

  MASTER.SEX,

  MR.MIGRT_OUT_REGION,

  MR.OUT_OPERA_TIME,

  MR.OUT_OPERA_ID,

  MR.IN_OPERA_TIME,

  MR.MIGRATE_STATE,

  MR.MIGRT_IN_REGION,

  case

  when MR.MIGRT_IN_REGION is null then

  '未选择'

  else

  ARC.REGION_NAME

  end AS MIGRT_IN_REGION_NAME

  FROM ADPM_MIGRATE_CPA MASTER, ADPM_MIGRATE_INFO MR

  left join ADPM_REGION_CODE ARC on MR.MIGRT_IN_REGION = ARC.REGION_CODE

  WHERE MASTER.PERSON_ID = MR.PERSON_ID

  AND (MR.MIGRATE_STATE = '10' OR MR.MIGRATE_STATE = '20' OR

  MR.MIGRATE_STATE = '60');

  SELECT 1 UPLOAD,

  0 SHENGJI,

  MR.BUSI_ID,

  MASTER.PERSON_ID,

  MASTER.ACNT_ID,

  MASTER.ID_NUM,

  MASTER.NAME,

  MASTER.SEX,

  MR.MIGRT_OUT_REGION,

  MR.OUT_OPERA_TIME,

  MR.OUT_OPERA_ID,

  MR.IN_OPERA_TIME,

  MR.MIGRATE_STATE,

  MR.MIGRT_IN_REGION,

  case

  when MR.MIGRT_IN_REGION is null then

  '未选择'

  else

  ARC.REGION_NAME

  end AS MIGRT_IN_REGION_NAME

  FROM ADPM_MIGRATE_CPA MASTER, ADPM_MIGRATE_INFO MR, ADPM_REGION_CODE ARC

  WHERE MASTER.PERSON_ID = MR.PERSON_ID

  AND (MR.MIGRATE_STATE = '10' OR MR.MIGRATE_STATE = '20' OR

  MR.MIGRATE_STATE = '60')

  AND MR.MIGRT_IN_REGION = ARC.REGION_CODE(+);

人气教程排行