Page 1 of 1

relative table fields

Posted: Mon Oct 27, 2003 8:53 am
by cybaf
is it possible (in mysql) to create a table with a field which is relative to other fields in the same table?

eg:

Code: Select all

create table testing (a int, b int, a+b as c)
this would make my life much easier...:)

Posted: Mon Oct 27, 2003 5:44 pm
by JAM
No. The closest thing I can think of is Views, but thats not supported in MySQL (yet, it's in devel i think).

But you can manage to do that directly in a select clause using CONCAT(), or similiar:

Code: Select all

mysql> SELECT CONCAT('PHP', 'D', 'N');
                        -> 'PHPDN'

Posted: Tue Oct 28, 2003 5:30 am
by cybaf
ok that's too bad... thanks anyways...