Any db admin expert?
Any one can help me, the question has provided a table call BALANCE_HISTORYBALANCE_HISTORY
SYSDATE CUST_CD ACC_CD CCY_CD BALANCE
2009-1-11 A0112 AP55 32 50000.00
2009-1-11 A0813 AP51 21 3500.00
2009-1-11 B9811 AP52 10 120000.00
2009-1-11 D9891 AP55 32 50.00
2009-1-12 A0813 AP51 21 4000.00
2009-1-12 B9811 AP52 10 120000.00
2009-1-12 D9891 AP55 32 52.50
2009-1-13 A0813 AP51 21 4000.00
2009-1-13 B9811 AP52 10 120000.00
2009-1-13 D9891 AP55 32 2.50
2009-1-14 A0813 AP51 21 1000.00
2009-1-14 B9811 AP52 10 120000.00
2009-1-14 D9891 AP55 32 102.50
What I need to find out is:
There is another table called BALANCE_MOVEMENT which is used to keep track of the balance difference of T and T-1 day. The schema of the BALANCE_MOVEMENT table is ( SYSDATE, CUST_CD, ACC_CD, CCY_CD, MOVEMENT_AMOUNT ). Please write down a single INSERT SQL statement to generate balance movement entries on sysdate = 2009-1-14.
I am not sure how to write the SQL statement of finding the T & T-1.Can anyone help?
頁:
[1]