select we_empnum, round(avg(anninc),2) as avg_anninc, max(anninc) as max_anninc, count(anninc) as cnt_anninc, count(openflag) as cnt_openflag, count(conameopen) as cnt_conameopen from queslist where we_empnum in ('01','02','03','04','05','06','07','08','09','10','11') group by we_empnum order by avg(anninc) desc select age ,agegroup ,sex ,pref ,builddv ,schooldv ,schoolsp ,anninc ,anntur ,we_ipo ,we_empnum ,we_capital ,occupacate ,occupaname ,post ,regperiod ,jobchcnt ,we_empform ,jobname ,jcat.catename as j_catename ,ecat.catename as e_catename ,userid ,nickname ,userattrib ,quesnum from queslist as ql left outer join jbn_job as jjob on we_job = jobid left outer join jbn_cate as jcat on we_cat = jcat.cateid left outer join category as ecat on indusclas = ecat.cateid where we_empnum = '01' where we_empnum = '02' where we_empnum = '03' where we_empnum = '04' where we_empnum = '05' where we_empnum = '06' where we_empnum = '07' where we_empnum = '08' where we_empnum = '09' where we_empnum = '10' where we_empnum = '11' order by anninc desc