insert into t_region
select  seq_region_id.nextval,t.REGION_ID,2, distinct r.city,r.city,'','','','1'from t_region t,t_test_region rwhere r.PROVICE=REGION_NAME;  
如何让distinct顺利通过??

解决方案 »

  1.   

    似乎 distinct 只能紧跟在select之后
    把distinct提前。
      

  2.   

    估计要这么写INSERT INTO t_region
      SELECT seq_region_id.NEXTVAL, a.*
        FROM (SELECT DISTINCT t.region_id, 2, r.city, r.city, '', '', '', '1'
                FROM t_region t, t_test_region r
               WHERE r.provice = region_name) a;