#1266 UNION in ROW_NUMBER sub-select does not eliminate duplicates

current-release
closed-fixed
1
2012-11-01
2012-10-30
rsteppac
No

Assuming 5 unique rows match the SELECT criteria of a ROW_NUMBER sub-select:

SELECT * FROM
(
SELECT ROW_NUMBER() OVER() AS row_num, inner.* FROM
(
SELECT ...
UNION
SELECT ...
) AS inner
) AS outer;

The expected output is 5 rows. In the attached example I get 10, every row duplicated once.

OS is Ubuntu 11.04
JDK is Oracle jdk1.6.0_31

Discussion

  • rsteppac

    rsteppac - 2012-10-30
     
  • Fred Toussi

    Fred Toussi - 2012-10-30

    When I run just the inner UNION query, it returns 10 rows.
    Each pair of similar rows have different last field (timestamp), one 2011, the other 2012. So there are no duplicates.
    As for ROW_NUMBER conditions, I will try to explain on the other bug report.

     
  • Fred Toussi

    Fred Toussi - 2012-11-01

    Fixed in latest snaphot.

     
  • Fred Toussi

    Fred Toussi - 2012-11-01
    • status: open --> closed-fixed
     
  • Fred Toussi

    Fred Toussi - 2012-11-01
    • priority: 5 --> 1
    • assigned_to: nobody --> fredt
     
  • rsteppac

    rsteppac - 2012-11-02

    Sorry. Stupid mistake on my end!

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks