SQL命令汇总

时间:2021-09-02 03:57:12

1. select rocketmq_id,broker_name,ip,count(*) as num  from t_rocketmq_node group by rocketmq_id,broker_name,ip having num>1 order by rocketmq_id;  查找主从在同一IP的集群和节点
2. select rocketmq_id,ip,port,type,count(*) as num  from t_rocketmq_node where type=‘namesrv‘ group by rocketmq_id having count(rocketmq_id) > 1  order by rocketmq_id; 查找所有集群对应的namesrv
3.