IT貓撲網(wǎng):您身邊最放心的安全下載站! 最新更新|軟件分類|軟件專題|手機版|論壇轉(zhuǎn)貼|軟件發(fā)布

您當前所在位置:首頁數(shù)據(jù)庫Oracle → Oracle連接查詢和sql語句中的條件判斷

Oracle連接查詢和sql語句中的條件判斷

時間:2015/6/28來源:IT貓撲網(wǎng)作者:網(wǎng)管聯(lián)盟我要評論(0)

  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

相關閱讀

文章評論
發(fā)表評論

熱門文章 Oracle中使用alter table來增加,刪除,修改列Oracle中使用alter table來增加,刪除,修改列oracle中使用SQL語句修改字段類型-oracle修oracle中使用SQL語句修改字段類型-oracle修使用低權(quán)限Oracle數(shù)據(jù)庫賬戶得到管理員權(quán)限使用低權(quán)限Oracle數(shù)據(jù)庫賬戶得到管理員權(quán)限Oracle對user的訪問控制Oracle對user的訪問控制

相關下載

人氣排行 ORACLE SQL 判斷字符串是否為數(shù)字的語句Oracle中使用alter table來增加,刪除,修改列的語法ORACLE和SQL語法區(qū)別歸納(1)oracle grant 授權(quán)語句如何加速Oracle大批量數(shù)據(jù)處理Oracle刪除表的幾種方法ORACLE修改IP地址后如何能夠使用Oracle 10g創(chuàng)建表空間和用戶并指定權(quán)限