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

解决方案 »

  1.   

    不知道你的数据到底什么样子
    这样不可以吗?
    insert into t_region 
    select distinct seq_region_id.nextval,t.REGION_ID,max(2), r.city,r.city,'','','','1' from t_region t,t_test_region r where r.PROVICE=REGION_NAME;  
      

  2.   

    insert into t_region
    select seq_region_id.nextval,t.REGION_ID,max(2),() distinct r.city,r.city,'','','','1'from t_region t,(select ... from t_test_region t_test_region group by r.city ....) as t2where   t.xxx=t2.xxx
    ....
      

  3.   

    distinct关键字是不是只能紧临差select关键字呢