MySQL Forums
Forum List  »  Spanish

calcular el total de una columna al insertar
Posted by: Fausto Disla
Date: December 15, 2019 07:49PM

Saludos,

Buenas soy un poco nuevo en MySql y tengo una consulta.

Tengo una tabla cust_orden con los siguientes campos

create table cust_order(
id int auto_increment,
orden int,
producto varchar(50),
cant int,
precio int,
total int
);
La creacion de la table esta bien

Lo que quiero es que cuando inserte un registro,
insert into cust_orden (orden, producto, cant, precio) values (102, 'Cucharas', 100, 2);
en la columna total me aparezca el total de 200 por ejemplo.

Muchas gracias por su ayuda.

Fausto Disla
Rep. Dom.

Options: ReplyQuote


Subject
Views
Written By
Posted
calcular el total de una columna al insertar
1117
December 15, 2019 07:49PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.