(anonymous) wrote:
> there is a table that has among others a integer primary key
> "id" and another integer column "prio" as well as an integer
> "group_id".
> I'd like to invert the values of the prio-column for one of the groups.
> The prio numbers start with 3 and there are 1159 different
> p
I don't have time to experiment with actual queries, but you can use the
rank() window function to rank rows with prio sorted ascending, and do the
same thing to rank rows with prio sorted descending, and update rows with
the value from the second where the rank matches the rank from the first.
I'
Hi,
there is a table that has among others a integer primary key "id" and
another integer column "prio" as well as an integer "group_id".
I'd like to invert the values of the prio-column for one of the groups.
The prio numbers start with 3 and there are 1159 different prios in this
group.
At