SELECT C.ORG_SHORTNAME, B.USER_NAME, ROW_NUMBER () OVER ( PARTITION BY B.ORG_ID ORDER BY A.TOTAL_SCORE DESC ) CNO, A.TOTAL_SCORE, A.USER_ID FROM T_INDIVIDUAL_RANKING A INNER JOIN T_USER B ON A.USER_ID = B.USER_ID INNER JOIN SYS_ORG C ON C.ORG_ID = B.
select a.id as aid,b.id as bid,a.city,a.cang,a.sid,a.time as atime,b.time as btime,a.price as aprice,b.price as bprice,a.pm as apm,b.pm as bpm from (select id,city,cang,sid,time,price,@rank:=@rank+1 as pm from cai,(SELECT @rank:=0) B group by id,ci
本文转自:http://blog.csdn.net/disiwei1012/article/details/52589181 http://www.blogjava.net/Jhonney/archive/2010/06/25/324503.html $ sqlplus user/pass SQL*Plus: Release - Production on Wed Aug :: Copyright (c) , , Oracle Corporation. All rights reserved.
需求: 小表数据量20w条左右,大表数据量在4kw条左右,需要根据大表筛选出150w条左右的数据并关联更新小表中5k左右的数据. 性能问题: 对筛选条件中涉及的字段加index后,如下常规的update语句仍耗时半小时左右. UPDATE WMOCDCREPORT.DM_WM_TRADINGALL A SET ( A.RELATIONSHIPNO, A.PACKAGE ) = (SELECT B.RELATIONSHIPNO, CASE ' ' ' ') THEN 'BC' ') THEN 'P