Janning Vygen [EMAIL PROTECTED] writes:
and this is the combined statement:
UPDATE temp_gc
SET gc_rank = ranking.rank
FROM (
SELECT
*,
ranking(r1.gc_gesamtpunkte, r1.gc_gesamtsiege) AS rank
FROM (
SELECT
mg_name,
Am Mittwoch, 13. Juli 2005 15:35 schrieb Tom Lane:
Janning Vygen [EMAIL PROTECTED] writes:
this way it works:
CREATE TEMP TABLE ranking AS *Q*;
EXECUTE 'UPDATE temp_gc SET gc_rank = ranking.rank
FROM ranking WHERE temp_gc.mg_name = ranking.mg_name;';
and this way it doesn't:
Hi,
Am Mittwoch, 13. Juli 2005 00:03 schrieb Tom Lane:
Janning Vygen [EMAIL PROTECTED] writes:
I have a guess, what happens here: The order of the subselect statement
is dropped by the optimizer because the optimizer doesn't see the
side-effect of the ranking function.
That guess is
Janning Vygen [EMAIL PROTECTED] writes:
this way it works:
CREATE TEMP TABLE ranking AS *Q*;
EXECUTE 'UPDATE temp_gc SET gc_rank = ranking.rank
FROM ranking WHERE temp_gc.mg_name = ranking.mg_name;';
and this way it doesn't:
UPDATE temp_gc
SET gc_rank = ranking.rank
FROM (*Q*)
ranking
Hi,
in postgresql you have several possibilites to get the rank of items. A thread
earlier this year shows correlated subqueries (not very performant) and other
tricks and techniques to solve the ranking problem:
http://archives.postgresql.org/pgsql-general/2005-05/msg00157.php
The
Janning Vygen [EMAIL PROTECTED] writes:
I have a guess, what happens here: The order of the subselect statement is
dropped by the optimizer because the optimizer doesn't see the side-effect
of the ranking function.
That guess is wrong.
I think the problem is that you are trying to update