基本MySQL命令

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);



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值