select (@id:=@id+1) as id,(@create_by:=NULL) as create_by,(@create_time:=NULL) as create_time,(@modify_by:=NULL) as modify_by,(@modify_time:=NULL) as modify_time,
t.county,sum(cnt) as cnt
from (
(select county,count(*) as cnt from drainage_plan_pipe
group by county
order by cnt desc)
union
(select county,count(*) as cnt from drainage_plan_sewageplant
group by county
order by cnt desc)
union
(select county,count(*) as cnt from drainage_plan_sludgedisposalfacility
group by county
order by cnt desc)
) as t,
(SELECT @id:=0 ) as id_temp,(SELECT @create_by:=NULL ) as create_by,(SELECT @create_time:=NULL ) as create_time,(SELECT @modify_by:=NULL ) as modify_by,(SELECT @modify_time:=NULL ) as modify_time
group by t.county