Advertisement
Advertisement
| 07.25.2008 at 02:13AM PDT, ID: 23594908 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: |
-- This query return error select l.deposit_id, sum(l.lot_value) as purchase_value, sum((SELECT get_market_value_deposit(fal.asset_id, fal.deposit_id) FROM financial_asset_lot fal WHERE fal.deposit_id = l.deposit_id GROUP BY fal.asset_id, fal.deposit_id)) as market_value FROM financial_asset_lot l group by l.deposit_id -- This one is working SELECT get_market_value_deposit(fal.asset_id, fal.deposit_id) FROM financial_asset_lot fal WHERE fal.deposit_id = 19 GROUP BY fal.asset_id, fal.deposit_id output ---------- get_market_value_deposit 72801.05 50000 72408.31 85818.99 20729.68 71936.92 86476.57 133503.17 43175.7 77237.51 238832.6 55936.8 71138.29 203409.2 20033 58187.06 307230 38015.04 81832.74 86476.73 126617 --------------- |