ORACLE SQL Navigator

題目:Table Name:客戶基本資料表(MSE04)、使用者帳戶基本資料表(SYS03)
請查出有效的客戶及顯示資料建立者的登錄工號及帳戶名稱,客戶編號以升冪排序

MSE04客戶基本資料
F01 資料識別碼
F02 客戶編碼
F03 客戶名稱
F05 有效否
F06 資料建立者資料識別碼
F07 資料建立時間
F08 資料異動者識別碼

SYS03 使用者帳戶基本資料表
F01 資料識別碼
F02 帳戶類別
F03 登入工號
F04 帳戶名稱
F05 登入密碼
F08 有效否
F09 登入條碼

這邊是否有SQL大神 可以幫幫我嗎??

1 Like

SQL神到! Just kidding. I’m going to use English just in case other learners can take something from it.

Translation:

Two tables: Customer Basic Data (MSE04) & User Account Basic Data (SYS03)

MSE04 Customer Basic Information columns:

  • data_id
  • customer_id
  • customer_name
  • is_valid
  • data_creator_id
  • data_creation_time
  • data_changer_id

SYS03 User Account Basic Data Table columns:

  • data_id
  • account_type
  • login_id
  • account_name
  • login_password
  • is_valid
  • login_barcode

Question:

Please find out valid customers and display the login ID and account name of the creator of the data. Customer numbers are sorted in ascending order.

My answer:

SELECT login_id, account_name
FROM MSE04
JOIN SYS03
  ON MSE04.data_id = SYS03.data_id
WHERE is_valid = 'true'
ORDER BY customer_id ASC;

Fellow SQL friends, please chime in if you have another answer!

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.