天天看点

sql 采样

方式1. 随机采样,抽取百分之5 的数据 rand(id)<0.05 

-- 随机采样 

-- create table tmp_info_ycf as 

-- select * from info_ycf where  rand(policy_id )< 0.03 limit 20000 ; 

-- ; 

方式2. 根据某个字段进行统计,数据尽量均匀,