我已将查询更新为
SELECT regexp_substr(a.NAME, '[^:]+$') AS emp_req
,a.COMPLETION_STATUS
,b.USER_TYPE
,b.display_name
FROM spt_result a
,spt_identity b
WHERE a.name LIKE 'Join%'
AND emp_req = b.display_name;
我想从spt_result table
中具有完成状态为错误或成功的spt_identity表中获取用户类型。表spt_result
包含
NAME COMPLETION_STATUS
----------------------------------------------------------------
Add/Remove Role(s) for:kc051363(1503085327459) Error
Joiner:sk080281 Success
和spt_identity contains
USER_TYPE DISPLAY_NAME
-----------------------------
Parttime-Regular pt092101
Parttime-Regular rm088923
Vendor wl090918
Parttime-Regular ne091924
Vendor dh090040
答案 0 :(得分:0)
加入DISPLAY_NAME
中NAME
的出现
SELECT i.*
FROM spt_identity i
JOIN spt_result r ON INSTR(r.name, i.display_name) > 0
WHERE r.completion_status IN ('Error', 'Success')