One solution could be adding a condition to the subquery to return the max score of the specific person.
Something like this (I added an alias for TABLE, and did some other naming changes):
<pre>update table t
set act_cmpswrt_score =
(Select MAX(sortest_test_score) from sortest where sortest_tesc_code = ‘CP1’ and sortest_pidm = t.act_pidm)
where sortest_pidm = t.act_pidm); </pre>
I don’t know if this will work on all databases, and I also do not know what database are you using, so please, let us know if it worked.