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顺利通过??
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顺利通过??
把distinct提前。
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;