Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 2 of 2 total |
RANGE behaviour |
Fri, Feb 15 2008 9:02 AM | Permanent Link |
Bojan Sinkovic | Dear newsgroups readers,
I am trying to imitate the MSSQL TOP function in ElevateDB. I came across the RANGE clause which seems like it would do it but I am not able to use it correctly. The SQL statement SELECT id FROM DATA ORDER BY id DESC returns 3 rows with values 3, 2 and 1. If I include the RANGE clause and modify the SQL statement into SELECT id FROM DATA ORDER BY id DESC RANGE 1 TO 1 it then returns only 1 row, which is correct, but the value is unexpectedly 1 when it should be 3 (as far as I understand the RANGE clause behaviour). Furthermore, if I execute the SQL statement SELECT id FROM DATA ORDER BY id DESC RANGE 2 TO 3 twice, the first time it returns 2 rows with values 2 and 1, the second time it returns 3 rows with values 3, 2 and 1. Could someone explain this strange behaviour or at least shed some light on how RANGE works? I am using the ElevateDB Manager (Unicode). Bojan |
Fri, Feb 15 2008 4:05 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Bojan,
<< I am trying to imitate the MSSQL TOP function in ElevateDB. I came across the RANGE clause which seems like it would do it but I am not able to use it correctly. The SQL statement SELECT id FROM DATA ORDER BY id DESC returns 3 rows with values 3, 2 and 1. If I include the RANGE clause and modify the SQL statement into SELECT id FROM DATA ORDER BY id DESC RANGE 1 TO 1 it then returns only 1 row, which is correct, but the value is unexpectedly 1 when it should be 3 (as far as I understand the RANGE clause behaviour). >> Yes, there is an issue with the RANGE clause when combined with the ORDER BY. A fix will be available by this weekend. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Friday, May 3, 2024 at 08:07 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |