ident src_ip dst_ip
现在将src_ip和dst_ip相同的放在一起并且ident从小到大显示。表中src_ip和dst_ip相同的不在一起,杂乱无章的。
3 个解决方案
#1
给出具体的数据看看
#2
mysql> select * from table order by src_ip,dst_ip;
mysql> select ident,src_ip,group_concat(dst_ip) from table group by src_ip;
mysql> select ident,group_concat(src_ip),dst_ip from table group by dst_ip;
mysql> select ident,src_ip,group_concat(dst_ip) from table group by src_ip;
mysql> select ident,group_concat(src_ip),dst_ip from table group by dst_ip;
#3
第一个稍微改一下就可以了
#1
给出具体的数据看看
#2
mysql> select * from table order by src_ip,dst_ip;
mysql> select ident,src_ip,group_concat(dst_ip) from table group by src_ip;
mysql> select ident,group_concat(src_ip),dst_ip from table group by dst_ip;
mysql> select ident,src_ip,group_concat(dst_ip) from table group by src_ip;
mysql> select ident,group_concat(src_ip),dst_ip from table group by dst_ip;
#3
第一个稍微改一下就可以了