Advertisement
dragonbs

Countries With or Without Rivers

Sep 28th, 2023
1,119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.31 KB | None | 0 0
  1. SELECT TOP(5) c.[CountryName], r.[RiverName]
  2. FROM [Countries] c
  3. LEFT JOIN [CountriesRivers] cr ON cr.[CountryCode] = c.[CountryCode]
  4. LEFT JOIN [Rivers] r ON cr.[RiverId] = r.[Id]
  5. LEFT JOIN [Continents] cn ON c.[ContinentCode] = cn.[ContinentCode]
  6. WHERE cn.[ContinentName] = 'Africa'
  7. ORDER BY c.[CountryName]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement