Re: [SQL] Debet-Credit-Balance Calculation

2005-04-22 Thread Ramakrishnan Muralidharan
-Credit-Balance Calculation Dear All,I have problem to calculation balance from debet and credit.my transaction table:    id |    trx_timestamptz | account  | trx_type_id |   amount++--+-+-  3 | 2005

Re: [SQL] Debet-Credit-Balance Calculation

2005-04-20 Thread Chris Browne
[EMAIL PROTECTED] ("Muhyiddin A.M Hayat") writes: >> There is an easy way to do this; write a plpgsql set returning >> function which adds the balance to the last column of the table. That >> query will always have a cost in both time and memory proportional to >> the size of the table, and the me

Re: [SQL] Debet-Credit-Balance Calculation

2005-04-20 Thread Muhyiddin A.M Hayat
There is an easy way to do this; write a plpgsql set returning function which adds the balance to the last column of the table. That query will always have a cost in both time and memory proportional to the size of the table, and the memory cost may bite you as table size grows... -- Can you give

Re: [SQL] Debet-Credit-Balance Calculation

2005-04-20 Thread Muhyiddin A.M Hayat
There is an easy way to do this; write a plpgsql set returning function which adds the balance to the last column of the table. That query will always have a cost in both time and memory proportional to the size of the table, and the memory cost may bite you as table size grows... -- Can you give

Re: [SQL] Debet-Credit-Balance Calculation

2005-04-19 Thread Christopher Browne
Oops! [EMAIL PROTECTED] ("Muhyiddin A.M Hayat") was seen spray-painting on a wall: > everything is ok, but when record > 100 that query eat all my > cpu process and take a long time, i have wait for 3 mimutes > but query doesn't finish. (pgsql-8.0-1 running on Dual Xeon 2.8 and > 2GB of RAM)

Re: [SQL] Debet-Credit-Balance Calculation

2005-04-19 Thread Mihail Nasedkin
I think you forget FOREIGN KEY: transactions.trx_type_id -> trx_type.id MAMH> Dear All, MAMH> I have problem to calculation MAMH> balance from debet and credit. MAMH> my transaction table: ... MAMH> CREATE TABLE "public"."transactions" ( MAMH>   MAMH> "id" SERIAL, MAMH>   "trx_timestamptz" TI

[SQL] Debet-Credit-Balance Calculation

2005-04-19 Thread Muhyiddin A.M Hayat
Dear All,I have problem to calculation balance from debet and credit.my transaction table:    id |    trx_timestamptz | account  | trx_type_id |   amount++--+-+-  3 | 2005-04-14 17:16:49+08 | 01.2010100.2 |