I need to count the no.of rooms in eachbuilding, each floor and in each zone..(like this in below picture)
I have tried using distinct and group by, but I am not getting required result.
You have not supplied the actual SQL you have trued, but something like this should work (obviously with the correct field / table names)
SELECT BuildingNo, Floor, Zone, COUNT(Rooms) AS NoOfRooms
FROM myTable
GROUP BY BuildingNo, Floor, Zone
ORDER BY BuildingNo, Floor, Zone
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.