I have to update a column in a very, very large table. So performance is a big issue.
The question is the similar to this one, but only for Sybase Adaptive Server Enterprise (ASE 12.5.4) plus I need to do an update on the retrieved rows. Is there a way to do it without a self join like in the top voted answer for Oracle?
This was the first attempt with a join, but it is by orders to slow for the table it is intended for:
UPDATE table SET flag = 1
FROM table AS a1
LEFT OUTER JOIN table AS a2
ON (a1.groupId = a2.groupId AND a1.id < a2.id)
WHERE a2.groupId IS NULL
and a1.somename in ('x', 'y')