CREATE OR REPLACE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vn2008`.`zoneNickname` AS SELECT `ap`.`warehouse_id` AS `warehouse_id`, `ap`.`agency_id` AS `agency_id`, `ap`.`zona` AS `zona`, concat( 'ZONA ', `ap`.`zona`, ' ', IF(`ap`.`zona` = 20, 'Madrid', `p`.`name`) ) AS `alias` FROM ( `vn2008`.`Agencias_province` `ap` JOIN `vn2008`.`province` `p` ON(`p`.`province_id` = `ap`.`province_id`) ) GROUP BY `ap`.`zona`, `ap`.`warehouse_id`, `ap`.`agency_id`