日期:2014-05-17 浏览次数:20919 次
declare N number; far_lat varchar2(32); far_lon varchar2(32); cursor c_CI is select distinct CI from CICENTER; c_row c_CI%rowtype; begin for c_row in c_CI loop select round(count(CI)*0.8) into N from CDL_ZX_20120315 where CI=c_row.CI and wso_sn=3 and (access_lat is not null or access_lon is not null); select access_lat into far_lat from tmp_access_latlon where CI=c_row.CI and n=N; select access_lon into far_lon from tmp_access_latlon where CI=c_row.CI and n=N; DBMS_OUTPUT.put_line(c_row.CI||'--'||N||'--'||far_lat||'--'||far_lon); END LOOP; end;