Reputation: 1207
As the title indicates, I want to create a view that combines multiple tables with different dates. The tables are as follow : (examples)
OutlookEmailsPerDay :
OutlookAttachmentsPerDay :
OutlookSyncPerDay :
OutlookSentEmailsPerDay :
Based on the ComputerSystemId, I want to join those tables to get a result similar to the one in this question : SQL - Combine two tables with different date value Does the same approach work for more than two tables. I know I can combine two tables then add another and so on, but is it possible to do it in one step?
Upvotes: 0
Views: 92
Reputation: 1292
Try this,
select *
from OutlookEmailsPerDay emails
inner join OutlookAttachmentsPerDay attachments on emails.ComputerSystemId = attachments.ComputerSystemId
inner join OutlookSyncPerDay sync on emails.ComputerSystemId = sync.ComputerSystemId
inner join OutlookSentEmailsPerDay sent on sent.ComputerSystemId = emails.ComputerSystemId
Upvotes: 1