Sum Attributes From The Same Table

Hi!

I just started learning yii so I’m still not too familiar with it.

OK, so I have a table called "patients" with the following attributes.

-severity

-disability

-accesibility

Each one a number from 0 to 20.

I want to have a fourth attribute, called "priority" that sums the three previous attributes, so I can sort my "patients" from most to least "priority".

I tried using a trigger in my database, but I want to see if I can do the same within my application.

Thanks!