[size=12.8000001907349px]Print the top 2 sale for the last two years info
[size=12.8000001907349px]
[size=12.8000001907349px]1. Assume the sale order table is in DB2 with the following colums
[size=12.8000001907349px]
[size=12.8000001907349px] EXEC SQL DECLARE CUSTOMER_SALE TABLE
[size=12.8000001907349px]
[size=12.8000001907349px] CUST_ID [size=12.8000001907349px] CHAR(6) NOT NULL,
[size=12.8000001907349px] SALE_DATE [size=12.8000001907349px] DATE NOT NULL,
[size=12.8000001907349px] SALE_AMOUNT DECIMAL(9, 2) NOT NULL
[size=12.8000001907349px]
[size=12.8000001907349px]2. The top one sale get 10% bouns of his total sale of that year
[size=12.8000001907349px] The top second Sale get 5% bouns of his total sale of that year
[size=12.8000001907349px]
[size=12.8000001907349px]3. Print the report below (Include 2015 and 2014)
[size=12.8000001907349px]
[size=12.8000001907349px] Cust_Id Sale_Date Sale_Amount Bonus
[size=12.8000001907349px] ----------- ------------- ------------------ --------
[size=12.8000001907349px] 100001 2015-04-01 $12,000.00
[size=12.8000001907349px] 2015-[size=12.8000001907349px]07-01 $18,000.00
[size=12.8000001907349px]
[size=12.8000001907349px] The toal $30,000.00 $3000.00
[size=12.8000001907349px]
[size=12.8000001907349px] xxxxxxx 2015-02-02 [size=12.8000001907349px] $18,000.00
[size=12.8000001907349px] 2015-[size=12.8000001907349px]07-02 $10,000.00
[size=12.8000001907349px]
[size=12.8000001907349px] The total $28,000.00 $1400.00
[size=12.8000001907349px]
[size=12.8000001907349px] xxxxxxx 2014-04-01 $18,000.00
[size=12.8000001907349px] 2014-[size=12.8000001907349px]07-01 $18,000.00
[size=12.8000001907349px]
[size=12.8000001907349px] The toal $36,000.00 $3600.00
[size=12.8000001907349px]
[size=12.8000001907349px] xxxxxxx 2014-02-02 [size=12.8000001907349px] $18,000.00
[size=12.8000001907349px] 2014-07-02 $12,000.00
[size=12.8000001907349px]
[size=12.8000001907349px] The total $30,000.00 $1500.00
代码应该怎么写啊!?