On Thursday 20 March 2003 21:10, Juan Nin wrote:

> Imagine I have a table with 3 colums (column1, column2, column3), which are
> of type INT.
>
> I want the data in column3 to be generated automatically from the one in
> column1 and column2 when it is inserted
> For example a sum, that the data in column3 be the sum of column1 and
> column2.
> If I insert a row that contains "2" for column1 and "3" for column2, the
> column3 should be automatically filled with "5".
>
> I know that in other DBMs this can be done with triggers, but MySQL still
> doesn't support them..

Why do you want to store the sum of columns? You can just sum them when you 
retrieve data. Even if you want to store sum, you can sum values in INSERT 
statement, can't you?


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to