我想通過使用從列ProecssInstanceName一個SQL查詢來獲取的唯一編號。快照如下所示。
現在我使用此查詢來獲取以下結果。查詢是
select c.StreamName AS Category,ProcessInstanceAppianID as jobId,a.ProcessInstanceName,a.ProcessInstanceTargetDate AS TargetDate,a.ProcessInstanceDescription as TaskDescription,b.Name as department
from InternalUseOnly..ProcessInstance a
join InternalUseOnly..Departments b on b.KeyDepartment=a.KeyDepartmentEntered AND b.updoperation <2
join InternalUseOnly..ProcessStream c on c.KeyProcessStream=a.KeyProcessStream and c.updoperation <2
where ProcessInstanceCompleted is null
and a.KeyProcessStream in
(330) and a.updoperation <2
在此先感謝。
我想你想使用'DISTINCT',但我不確定我是否有問題。 – asafrob
基於結果集後所需的輸出圖片中所顯示 – peterm
嘗試......力測試... SELECT SUBSTRING(ProecssInstanceName,PATINDEX( '%[0-9]%',ProecssInstanceName,LEN(ProecssInstanceName))) AS號FROM表名; –