Creating a field that uses totals other fields?

Поиск
Список
Период
Сортировка
От Sloan Bowman
Тема Creating a field that uses totals other fields?
Дата
Msg-id 5.1.1.6.2.20020918111926.00a82058@mail.nashlinux.com
обсуждение исходный текст
Список pgsql-sql
I am wanting to create a table that will sum up the total of an order and 
automatically put value in the specified field. An example of the table is 
below. Any ideas on how to do this.

CREATE TABLE  sales_info (
sales_id serial PRIMARY KEY,
prod_id int REFERENCES product (prod_id),
qty int,
unit_price numeric(4,2),
sub_total numeric(4,2),
tax numeric(4,2),
shipping numeric(4,2),
grand_total numeric(4,2));
The grand total is where I want the sum of the unit_price, tax, and 
shipping price entered automatically. Thanks for any help.


--Sloan



В списке pgsql-sql по дате отправления:

Предыдущее
От: "david williams"
Дата:
Сообщение: Re: Returning a reference to a cursor from a function
Следующее
От: "Ewan Grantham"
Дата:
Сообщение: TSQL2 (Temporal SQL) support for Postgres