现在是用create table syn_count as select srcip,dstip,dstport,count(*) from syn
group by srcip,dstip,dstport;
这个语句 生成新表,想把表名定义为"date"_syn_count
date为当前日期
然后对"date"_syn_count这个表进行处理,挑出count(*)字段中大于1000的,输出到新表"date"_syn_count_high
大于100小于1000的 输出到新表"date"_syn_count_middle
小于100的输出到新表"date"_syn_count_low
group by srcip,dstip,dstport;
这个语句 生成新表,想把表名定义为"date"_syn_count
date为当前日期
然后对"date"_syn_count这个表进行处理,挑出count(*)字段中大于1000的,输出到新表"date"_syn_count_high
大于100小于1000的 输出到新表"date"_syn_count_middle
小于100的输出到新表"date"_syn_count_low
PREPARE stml FROM @asql;
EXECUTE stml;
这样以后查的话 也好查谢谢几位指点,我去看下用bash实现吧不过取范围值的是不是还是用mysql好点,听说有现成的函数?
where count(*) > '1000';1111 - Invalid use of group function
这么写怎么报错呢
select srcip,dstip,dstport,count(*) from syn
group by srcip,dstip,dstport having count(*) > 1000;