Skip to content

Instantly share code, notes, and snippets.

@gdoddsy
Last active November 11, 2018 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdoddsy/a10c7246f23915518d76de9ca5200dfc to your computer and use it in GitHub Desktop.
Save gdoddsy/a10c7246f23915518d76de9ca5200dfc to your computer and use it in GitHub Desktop.
WITH AggregateData AS
(
SELECT Gate
,MAX(RecordedTime) AS MaxRecordedTime
FROM dbo.SFOGateInfo
)
UPDATE AggregateTest
SET LastUsedDateTime = AggregateData.MaxRecordedTime
FROM AggregateTest
INNER JOIN AggregateData
ON AggregateData.Gate = AggregateTest.Gate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment