对于以下查询获得的所有结果,如何将 a.age 和 b.age 更新为 32。临时列是“CID”,如下例所示
select *
from (SELECT ROW_NUMBER()
OVER (PARTITION BY CUST_NAME ORDER BY CUST_NAME) AS CID,CUST_NAME,AGE,CITY,COLUMNB
FROM (select CUST_NAME,AGE,CITY,COLUMNB
from SOMETABLE
where date = '26-jULY-2012'))a
RIGHT join (select *
from (SELECT ROW_NUMBER()
OVER (PARTITION BY CUST_NAME ORDER BY CUST_NAME) AS CID,CUST_NAME,AGE,CITY,COLUMNB
FROM (select CUST_NAME,AGE,CITY,COLUMNB
from SOMETABLE2
where date = '26-jULY-2012')))b
on a.CID=b.CID
and a.CUST_NAME=b.CUST_NAME
ORDER BY a.CUST_NAME,A.CID,a.COLUMNB;