mysql> CREATE OR REPLACE VIEW `vw_rgroups` AS -> SELECT rg.name as rgroup, -> cl.name as cluster, -> GROUP_CONCAT(srv.hostname SEPARATOR ';') AS nodes, -> GROUP_CONCAT(vs.name SEPARATOR ';') AS zones, -> rg.added as added, -> rg.updated as updated, -> rg.online as online, -> cnode.hostname as current -> FROM -> (clusters cl JOIN (jt_clusters_servers jt1 JOIN servers srv ON srv.id=jt1.id_server) ON cl.id=jt1.id_cluster) -> JOIN rgroups rg ON rg.id_cluster=cl.id -> LEFT JOIN (jt_rgroups_vservers jt2 LEFT JOIN vservers vs ON jt2.id_vserver=vs.id) -> ON rg.name=jt2.name AND -> cl.id=jt2.id_cluster AND -> srv.id=vs.id_server, -> servers cnode -> WHERE -> cnode.id=rg.id_current -> GROUP BY cl.name,rg.name; Query OK, 0 rows affected (0.01 sec) mysql> select * from vw_rgroups where cluster='uxhadesc010'; +----------------+-------------+-------------------------+-------+------------+------------+--------+-------------+ | rgroup | cluster | nodes | zones | added | updated | online | current | +----------------+-------------+-------------------------+-------+------------+------------+--------+-------------+ | a154d02p-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc012 | | a174d00p-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | advq-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | arwp-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | backup1-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | iasp-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | mysql-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | mysqldwp-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | ora10202_01-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc012 | | ora10202_02-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | ora10202_03-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | ora10202_04-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | ora10204_01-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | ora10204_02-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | ora8174_01-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | ora8174_02-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | ora9206_01-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | ora9206_02-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | ora9206_03-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | oraadm_01-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | | rman-rg | uxhadesc010 | uxhadesc011;uxhadesc012 | NULL | 1287667262 | 1296442817 | 1 | uxhadesc011 | +----------------+-------------+-------------------------+-------+------------+------------+--------+-------------+ 21 rows in set (0.48 sec) mysql> select * from vw_rgroups where cluster='uxorionc010'; +-------------------+-------------+-------------------------+-----------+------------+------------+--------+-------------+ | rgroup | cluster | nodes | zones | added | updated | online | current | +-------------------+-------------+-------------------------+-----------+------------+------------+--------+-------------+ | arte2-ocapi-01-rg | uxorionc010 | uxorionc011;uxorionc012 | ip06;ip06 | 1294141879 | 1296442893 | 1 | uxorionc011 | | i-arte2-pro01-rg | uxorionc010 | uxorionc011;uxorionc012 | ip06;ip06 | 1287661757 | 1296442893 | 1 | uxorionc011 | | i-ias-pro01-rg | uxorionc010 | uxorionc011;uxorionc012 | ip08;ip08 | 1287661757 | 1296442893 | 1 | uxorionc012 | | i-ora-pro01-rg | uxorionc010 | uxorionc011;uxorionc012 | ip01;ip01 | 1287661757 | 1296442893 | 1 | uxorionc012 | | i-ora-pro02-rg | uxorionc010 | uxorionc011;uxorionc012 | ip01;ip01 | 1287661757 | 1296442893 | 1 | uxorionc011 | | i-ora-pro03-rg | uxorionc010 | uxorionc011;uxorionc012 | ip01;ip01 | 1287661757 | 1296442893 | 1 | uxorionc012 | | i-ora-pro04-rg | uxorionc010 | uxorionc011;uxorionc012 | ip01;ip01 | 1287661757 | 1296442893 | 1 | uxorionc011 | | i-ora-pro05-rg | uxorionc010 | uxorionc011;uxorionc012 | ip01;ip01 | 1287661757 | 1296442893 | 1 | uxorionc012 | | i-ora-pro06-rg | uxorionc010 | uxorionc011;uxorionc012 | ip01;ip01 | 1287661757 | 1296442893 | 1 | uxorionc011 | | i-ora-pro07-rg | uxorionc010 | uxorionc011;uxorionc012 | ip01;ip01 | 1294141879 | 1296442893 | 1 | uxorionc011 | | i-ora-pro08-rg | uxorionc010 | uxorionc011;uxorionc012 | ip01;ip01 | 1294141879 | 1296442893 | 1 | uxorionc011 | | i-tomcat-pro01-rg | uxorionc010 | uxorionc011;uxorionc012 | ip07;ip07 | 1294141879 | 1296442893 | 1 | uxorionc011 | +-------------------+-------------+-------------------------+-----------+------------+------------+--------+-------------+ 12 rows in set (0.49 sec) mysql>