Heim  >  Artikel  >  Datenbank  >  Oracle连接查询和sql语句中的条件判断

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

WBOY
WBOYOriginal
2016-06-07 15:13:511987Durchsuche

欢迎进入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(+);

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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn