-1
--Receive_Amount Having Column
________________________________________________
PID Head Receive_Date Amount
------------------------------------------------
1001 consumeable 12/8/2011 20,000
1001 Manpower 12/8/2011 1,00,000
1001 Travel 13/8/2011 40,000
1001 Travel 18/8/2011 10,000
1001 consumeable 5/09/2011 10,000
--Second Table
--Expenditure Table
PID Head Exp_Date Amount
------------------------------------------------
1001 Travel 13/8/2011 2,000
1001 consumeable 13/8/2011 5,000
1001 Travel 18/08/2011 1,000
--And Third Table
--Advance Table Having Column
_____________________________________________
PID Head Adv_Date Amount
---------------------------------------------
1001 Travel 14/08/2011 3,000
我想從這些3個表插入數據的臨時表插入數據到臨時表
___________________________________________________________________________
PID Trans_Date Head Head_Balance Exp_Amount Running Total
___________________________________________________________________________
1001 13/8/2011 Travel 40,000 2,000 2,000
1001 13/8/2011 consumeable 20,000 5,000 7,000
1001 18/08/2011 Travel 48,000 1,000 8,000
什麼是你的問題,你到目前爲止嘗試過什麼? –
我需要編寫所有查詢,然後創建一個臨時表,但代碼在哪裏? – Dezigo
您能詳細說明源表中的哪些值需要轉到臨時表(我無法從輸出中需要的** PID Head Adv_Date Amount **中看到任何內容),您需要的任何業務邏輯以及你嘗試過的和/或什麼不適合你的例子。 – MatBailie