Ordering doesn't work with projection #1911

Open
studiodev opened this Issue Dec 24, 2013 · 3 comments

3 participants

@studiodev

Hello,

I've just discovered a weird behavior on ordering. The result is not the same between a SELECT FROM X and SELECT Y FROM X with ordering.

The dabatase used for this example is attached to this issue.

SELECT FROM MediationNetwork ORDER BY stats_nbIndividuals DESC or SELECT @rid, stats_nbIndividuals FROM MediationNetwork ORDER BY stats_nbIndividuals DESC

12:62000, 12:64837, 12:48976, 12:55737... It's good

SELECT @rid FROM MediationNetwork ORDER BY stats_nbIndividuals DESC`

12:32799, 12:32800, 12:32801, 12:32802, 12:32803...

Configuration
OrientDB 2.0-SNAPSHOT (build 12/23/2013)
Storage: plocal
DB : https://mega.co.nz/#!6R10UahI!RYWK41eoQlX5rhL4pNpFAnglbU9Ey5fUj9I3zctJ8RY

@lvca
OrientDB member

As in standard SQL you should include the order by fields in the projection too. So in the second case simply doesn't order. Maybe an error would be more useful.

@lvca lvca was assigned Dec 24, 2013
@studiodev

Ok, I didn't know it was a SQL standard.
However, standard RDBMS (mysql, postgres) doesn't follow this rule, so yes, an error or at least a word in the documentation is a good idea.

@lvca
OrientDB member

You're right. Seems that this isn't standard.

@lvca lvca modified the milestone: 2.1, 2.0-M1 Sep 16, 2014
@lvca lvca assigned luigidellaquila and unassigned lvca Jan 31, 2015
@lvca lvca modified the milestone: 2.1-rc1, 2.1-rc2 Apr 1, 2015
@lvca lvca modified the milestone: 2.1-rc2, 2.1 GA May 5, 2015
@lvca lvca modified the milestone: 2.2, 2.1 GA, 3.0 Jul 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment