pythonwindows下中文目录:
link_filepath.decode('utf8').encode('gbk')
1.怎样将数据表自增id重新归零?
mysql> truncate table 表名;
2.在router数据中使用:
select count(country) from routergeoinfo where country='US';
select count(country) from routergeoinfo where country='CN' and city='***';
select country,count(*) from routergeoinfo group by country;
select country,count(*) from routergeoinfo group by country order by count(*) desc;
select count(*),organization,geolocation,ip_type from prefixinfo group by organization,geolocation,ip_type;
3.将查询数据重新插入新表中
insert into 201603_asorder(as_number,count)select count(*),as_number from 201603_routerasinfo group by as_number;
insert into 4134routergeo(router_id,continent,country,region,city,latitude,longitude) (select router_id,continent,country,region,city,latitude,longitude from routergeoinfo where router_id in (select router_id from routerasinfo where as_number = '4134'));
4.将筛选出的数据按照某一列进行求和
select count(*),sum(number),organization,geolocation,ip_type from prefixinfo group by organization,geolocation,ip_type;
select sum(temp1.number) from (select number from prefixinfo where organization in 'EC2'and ip_type='ipv4') as temp1;
5.
Alibaba关系筛选:
select* from as_rel_cn where source in (37963,45096.45102,45103,45104,59028,59051,59052,59053,59054,59054,59055,134963) or destination in (37963,45096.45102,45103,45104,59028,59051,59052,59053,59054,59054,59055,134963);