就是按order by ADDRESS,Amount desc ,
然后取前两条记录,后面的用others 代替,汇总金额成第三条记录,
也就是说不管原始记录有多少条,我只能取金额最高的两条和其它的汇总成一条记录,DRDL01变为others 即可例如记录为:
ADDRESS_NUMBER CUSTOMER DRDL01 IMSRP1 BEFORETWOYEAR
1 10003051 ALPHA START LIMITED PO ......
表结构及数据如下:
ADDRESS CUSTOMER DRDL01 IMSRP1 Amount
1 10003051 ALPHA START LIMITED POLY COVERED CORE PC 1425501.63
2 10003051 ALPHA START LIMITED SPUN POLYESTER SP 404370.41
3 10003051 ALPHA START LIMITED TRILOBAL AIR ENTANGLED POLY TL 9700
4 10003051 ALPHA START LIMITED SAK COTTON CS 38.3
......
oracle执行计划中一些数字是什么意思,谁有这方面的资料给我学习学习
比如
PSTART,PSTOP等的数字是什么意思啊
----------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Ps ......
CREATE TABLE USERINFO
(
USER_CD INT AUTO_INCREMENT PRIMARY KEY,
USER_NAME VARCHAR(20) NOT NULL,
ROLE_CD INT NOT NULL,
SEX CHAR(4) NOT NULL,
PHOTO_PATH VARCHAR (100),
BIRTHDAY DATE,
PROVINCE_CD INT,
CITY_CD INT,
......
create or replace trigger......触发器
.....中间省略
begin
tablename:='CLTX_'||'201002';
insert into tablename(SBBH,FXBH,HPHM,HPZL,HPYS) values(:new.SBBH,:new.FXBH,:new.HPHM,:new.HPZL,:new.HPYS);
--如何把变量tablename作为表名放在into后面,我这样直接跟在into后面报错
ora-04098 trigger ... is inva ......
SQL code:
select a.transactionid, a.creator, a.creattime, a.updatetime,
a.status, a.handletimes, a.operatetype, a.objecttype,
a.objectid, a.objectname, a.objecturl, a.nettype,
a.netid, a.returntime, a.returncode, a.returndesc, a.netstatus,b.netname
from t_cms_trans ......