23 Oct 2011 by Mehdi Gholam
The group by can return multiple rows so it can not be used in a single row.try the following:CREATE VIEW TEST ASSELECT CC_Name, COUNT(*) as Total_Beds, 0 as Occupied_Beds, 0 as Free_bed from bed union SELECT cc_name, 0 as Total_Beds, COUNT(*) as Occupied_Beds, 0 as Free_bed FROM...