In SQL Server I wrote a query to count specific columns but I am displaying all count in more than one table, it’s not a good way to show. How to display all tables in single row in new table?
select COUNT(s.AssetSubType) as 'PhysicalServers' from Asset s
where s.CompanyId = @companyId and
s.AssetType = 1 and
s.AssetSubType = 4
select COUNT(s.AssetSubType) as 'WorkStations' from Asset s
where s.CompanyId = @companyId and
s.AssetType = 1 and
s.AssetSubType = 1 or s.AssetSubType = 3
select COUNT(s.AssetSubType) as 'EmailOnlyUsers' from Asset s
where s.CompanyId = @companyId and
s.AssetType = 2 and
s.AssetSubType = 16
select COUNT(s.OperatingSystem) as '#OfMSServers' from Asset s
where s.CompanyId = @companyId and
s.AssetType = 1 and
s.AssetSubType = 4 and
s.OperatingSystem = 1
select COUNT(s.OperatingSystem) as '#OfLinuxServers' from Asset s
where s.CompanyId = @companyId and
s.AssetType = 1 and
s.AssetSubType = 4 and
s.OperatingSystem = 2
Something like this should work for you