From: | "betty" <liongliong(at)telkom(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: conversi ms-sql7 vs postgresql 7.3 |
Date: | 2003-02-10 05:10:57 |
Message-ID: | b27bnl$1gb8$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
hi Christoph,
your command :
"UPDATE xx SET balance=balance+debet-credit "
result calculate balance for each row, ex:
id debet credit balance
1 1000 0 1000
2 2000 0 2000
3 0 2500 -2500
4 0 100 -100
not result calculate balance, ex:
id debet credit balance
1 1000 0 1000
2 2000 0 3000
3 0 2500 500
4 0 100 400
regards
betty
"Christoph Haller" <ch(at)rodos(dot)fzk(dot)de> wrote in message
news:3E438396(dot)2983BD2B(at)rodos(dot)fzk(dot)de(dot)(dot)(dot)
> >
> > I have table xx:
> > id debet credit balance
> > 1 1000 0 0
> > 2 2000 0 0
> > 3 0 2500 0
> > 4 0 100 0
> >
> > command in ms-sql 7 can use calculate field (column) balance from id=1
> to
> > id=4:
> > "update xx set bal=balance=bal+debet-credit"
> > result:
> > id debet credit balance
> > 1 1000 0 1000
> > 2 2000 0 3000
> > 3 0 2500 500
> > 4 0 100 400
> >
> > How command sql can use in psotgresql 7.3?
> >
> Try
> UPDATE xx SET balance=balance+debet-credit ;
>
> Regards, Christoph
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
From | Date | Subject | |
---|---|---|---|
Next Message | postgresql | 2003-02-10 07:06:31 | PostgreSQL SQL Conformance |
Previous Message | Frankie Lam | 2003-02-10 03:39:54 | Re: plpgsql + dblink() question |