I know how to do it in creating a table but is there a way to add or update a column and set it as the sum of two or more existing columns? thank you in advance.
You can add a computed column:
alter table t add column sumcol as (col1 + col2);
The value is calculated when the table is queried, so it is always up-to-date.
1.4m articles
1.4m replys
5 comments
57.0k users