Ok, I’m looking for a way to make a certain field be equal to the sum of 3 other fields. I have 3 different rating fields, and then an ‘overall rating’ field, which I need to be automatically equal the sum of the other 3. I know how to retrieve the value using a select statement, I just want it to happen automatically in the table.
-Using MySQL
Ok, I’m looking for a way to make a certain field be equal to
Share
There are different ways to do this in different DBMSes, for example Virtual Columns,
in Oracle:
in SQL Server:
Unfortunatelly not all DBMSes support virtual columns. The most generic (working on most DBMSes) way to do this, and yet probably the best for your needs (no database structural change needed) is creating a view, for example like: