Skip to content
Advertisement

Get some set of values in SQL Server

I have a query, in this query I need to get a number of classes (class count) in each district. In here it comes only those who have classes. So I need to show the district’s it doesn’t have a classes as well.

My District table consist 25 values. and my class coverage table has 5 values to 3 districts. I need to show all the districts.

C#

Code

Advertisement

Answer

You need to join your tables the other way, from districts to classes, to ensure that all district values are in the output:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement