Hi, I have experienced this bug too, and am reproducing the example posted here on Aug-SP1 on windows. Is this a known bug? Any prospects of having it fixed? LeonardF wrote:
Hi There,
I have some problem with the row_number() over() function. Consider the following table: create table "table1" ("customer" varchar(40), "product" varchar(40), "price" double) insert into "table1" values ('cust1', 'p1', 100) insert into "table1" values ('cust1', 'p2', 200) insert into "table1" values ('cust1', 'p3', 150) insert into "table1" values ('cust2', 'p1', 300) insert into "table1" values ('cust2', 'p3', 200)
The following query over this table: SELECT "customer", "product", "sumprice", (Row_number() OVER(PARTITION BY "customer" ORDER BY "sumprice")) as "rank" FROM ( SELECT "customer", "product", (Sum("price")) AS "sumprice" FROM "table1" GROUP BY "customer", "product") AS "temp"
Returns: Customer product sumprice rank Cust1 p1 100 1 Cust1 p2 200 2 Cust1 p3 150 3 Cust2 p1 300 1 Cust2 p3 200 2
But doesn’t it suppose to return the following result set?: Customer product sumprice rank Cust1 p1 100 1 Cust1 p3 150 2 Cust1 p2 200 3 Cust2 p3 200 1 Cust2 p1 200 2
Thanks
-- Leonard Forgge
-- View this message in context: http://old.nabble.com/Possible-wrong-results-when-Querying-tp22821802p262812... Sent from the monetdb-users mailing list archive at Nabble.com.