-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
BugIncorrect or unexpected behaviorIncorrect or unexpected behaviorSQLIssues or changes relating to SQL executionIssues or changes relating to SQL execution
Description
Describe the bug
if use order by clause in select sql like this:
select row_number() over(partition by sensorId order by temp),temp,ts from 'readings' where sensorId = 5109 order by temp;
the result out of order
row_number | temp | ts
------------+--------------------+----------------------------
582 | 15.004434478999105 | 2019-11-25 21:29:54.200000
497 | 15.02493720762422 | 2019-11-20 17:06:55.200000
To reproduce
- run this sql
select row_number() over(partition by sensorId order by temp),temp,ts from 'readings' where sensorId = 5109 order by temp;
- return result
row_number | temp | ts
------------+--------------------+----------------------------
582 | 15.004434478999105 | 2019-11-25 21:29:54.200000
497 | 15.02493720762422 | 2019-11-20 17:06:55.200000
28 | 15.027997591584324 | 2019-10-19 07:09:02.300000
90 | 15.046235126104243 | 2019-10-23 07:44:49.800000
396 | 15.047976089120429 | 2019-11-14 07:48:38.600000
573 | 15.052348178001584 | 2019-11-24 21:35:39.700000
69 | 15.059114960868015 | 2019-10-21 22:11:40.600000
700 | 15.080164510482806 | 2019-12-04 20:56:32.900000
727 | 15.081847565313176 | 2019-12-07 06:20:40.500000
776 | 15.096766057248669 | 2019-12-10 22:21:52.300000
754 | 15.097841725312733 | 2019-12-08 22:01:43.700000
Expected Behavior
return result
row_number | temp | ts
------------+--------------------+----------------------------
0 | 15.004434478999105 | 2019-11-25 21:29:54.200000
1 | 15.02493720762422 | 2019-11-20 17:06:55.200000
2 | 15.027997591584324 | 2019-10-19 07:09:02.300000
3 | 15.046235126104243 | 2019-10-23 07:44:49.800000
4 | 15.047976089120429 | 2019-11-14 07:48:38.600000
5 | 15.052348178001584 | 2019-11-24 21:35:39.700000
6 | 15.059114960868015 | 2019-10-21 22:11:40.600000
7 | 15.080164510482806 | 2019-12-04 20:56:32.900000
8 | 15.081847565313176 | 2019-12-07 06:20:40.500000
9 | 15.096766057248669 | 2019-12-10 22:21:52.300000
10 | 15.097841725312733 | 2019-12-08 22:01:43.700000
11 | 15.104586453742463 | 2019-12-19 13:33:19.700000
Environment
- **QuestDB version**: main
- **OS**: MacOS
- **Browser**: ChromeAdditional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugIncorrect or unexpected behaviorIncorrect or unexpected behaviorSQLIssues or changes relating to SQL executionIssues or changes relating to SQL execution