select sum((
SELECT
SUM (gb.period_net_dr - gb.period_net_cr) "PTD"
FROM gl_balances gb, gl_code_combinations gcc
WHERE
gb.period_name = NVL(:P_PERIOD,gb.period_name)
AND gb.currency_code = (SELECT currency_code FROM gl_ledgers WHERE ledger_id = gb.ledger_id)
AND gcc.segment4 =(select FLEX_VALUE from FND_FLEX_VALUES_VL where description ='Pass Through Costs To Be Realised')
AND gb.code_combination_id = gcc.code_combination_id)
+
(SELECT
SUM (gb.period_net_dr - gb.period_net_cr) "PTD"
FROM gl_balances gb, gl_code_combinations gcc
WHERE
gb.period_name = NVL(:P_PERIOD,gb.period_name)
AND gb.currency_code = (SELECT currency_code FROM gl_ledgers WHERE ledger_id = gb.ledger_id)
AND gcc.segment4 =(select FLEX_VALUE from FND_FLEX_VALUES_VL where description ='Pass Through Costs Realised')
AND gb.code_combination_id = gcc.code_combination_id)) as Total_Pass_Through_Costs
from
dual)
(select sum((
SELECT
SUM (gb.period_net_dr - gb.period_net_cr) "PTD"
FROM gl_balances gb, gl_code_combinations gcc
WHERE
gb.period_name = NVL(:P_PERIOD,gb.period_name)
AND gb.currency_code = (SELECT currency_code FROM gl_ledgers WHERE ledger_id = gb.ledger_id)
AND gcc.segment4 =(select FLEX_VALUE from FND_FLEX_VALUES_VL where description ='Services Billing')
AND gb.code_combination_id = gcc.code_combination_id)
+
(SELECT
SUM (gb.period_net_dr - gb.period_net_cr) "PTD"
FROM gl_balances gb, gl_code_combinations gcc
WHERE
gb.period_name = NVL(:P_PERIOD,gb.period_name)
AND gb.currency_code = (SELECT currency_code FROM gl_ledgers WHERE ledger_id = gb.ledger_id)
AND gcc.segment4 =(select FLEX_VALUE from FND_FLEX_VALUES_VL where description ='pass Through Billing')
AND gb.code_combination_id = gcc.code_combination_id)) as Total_Billing
from
dual
如何消除這種誤差 (java.sql.SQLSyntaxErrorException:ORA-00933:SQL命令不能正確地結束)如何消除這種誤差
你什麼時候得到錯誤?你想做什麼 ? –
這是幾個單獨的查詢... – jarlh
我得到兩個這(Total_Billing,Total_Pass_Through_Costs)。 –