我有一個SQL查詢應用不同的單柱
select distinct
Process.ReportLogProcessID as [Process.ReportLogProcessID],
Process.ProcessTitle as [Process.ProcessTitle],
CAST(User0.PrimaryEmail AS nvarchar(max)) as [Process_Contacts.IsPrimaryContact]
from
ReportProcess as Process inner join
ReportProcessContact as ReportProcessContact0 on
((ReportProcessContact0.SessionID = Process.SessionID)) left outer join
[User] as User0 on
((ReportProcessContact0.ReferenceID = User0.UserID)) left outer join
[Group] as Group0 on
((ReportProcessContact0.ReferenceID = Group0.GroupID and
ReportProcessContact0.ReferenceType = 2))
order by
[Process.ProcessTitle] asc
,並在下面給出結果
,如果你看到它返回一個相同的「流程Title'-」兩行Testing123'有什麼辦法可以區分這一點,儘管無論是「Process Contact」。
是否有任何方法來區分特定列的基礎上的結果?
所以這'email'它應該然後返回? –
什麼是電子郵件ID,它應該只返回一行,無論是與[email protected]或[email protected],因爲兩者都有相同的過程標題 – BreakHead
而你不在乎哪個?這是任意的? –