1
在此任一幫喜歡能「希望2行也在第一行」 ..SQL Server的內部連接
SELECT BDSReleaseBDDSBPD.ProjectID,
BDSFlowDetails.Flowid,IterationID,
case when ReleaseTask = 'BDDS' then UID end as 'BDDS UID' ,
case when ReleaseTask = 'BDDS' then Concat(FirstName,'_',Lastname) end as BDDSReleasedBy,
case when ReleaseTask = 'BDDS' then ReleaseDate end as 'BDDS Released Date' ,
case when ReleaseTask = 'BPD' then UID end as 'BPD UID' ,
case when ReleaseTask = 'BPD' then Concat(FirstName,'_',Lastname) end as BPDReleasedBy,
case when ReleaseTask = 'BPD' then ReleaseDate end as 'BPD Released Date'
FROM BDSReleaseBDDSBPD
inner join BDSFlowDetails on BDSFlowDetails.FlowID = BDSReleaseBDDSBPD.FlowID
inner join BDSUserProfile on BDSUserProfile.UserName=BDSReleaseBDDSBPD.UserName
WHERE BDSReleaseBDDSBPD.ProjectID = 861
order by BDSFlowDetails.Flowid
[SQL結果集..] [![請在此輸入圖片說明] [1] [1]