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


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to