Написал запрос
Select (Hostel.RoomsCount - Count(Rooms.RoomId)) AS FreeRooms
From Rooms inner join Hostel ON (Hostel.HostelCode=Rooms.HostelCode)
WHERE Hostel.HostelCode= 1
Выводит ошибку
Column 'Hostel.HostelCode' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.