Skip to content

Instantly share code, notes, and snippets.

@alimozdemir
Created June 6, 2020 18:49
Show Gist options
  • Save alimozdemir/21ac551cfd2abd4d001641ec9a17a123 to your computer and use it in GitHub Desktop.
Save alimozdemir/21ac551cfd2abd4d001641ec9a17a123 to your computer and use it in GitHub Desktop.
View Example
CREATE VIEW vw_Songs
AS
SELECT s.Id, s.Title, MIN(ISNULL(cs.[Status], 0) + 0) CountryStatus
FROM Song AS s
LEFT JOIN dbo.Country_Songs AS cs ON cs.SongId = s.Id
GROUP BY s.Id, s.Title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment