influxdata / influxdata/influxdb

About Group by,Order by and limit

Open
#25,274 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

# synopsis
I use version 1.8
I want to use Group by and Order by Time to query data
# __Steps to reproduce:__
**Data**
![image](https://github.com/user-attachments/assets/cedc87bf-5b9c-42f1-ba71-407f8c79aa8c)

**my sql**
`SELECT * FROM (
select last("3021") as "3021",last("3024") as "3024",last("3020") as "3020",last("3030") as "3030",last("3031") as "3031"
from cr_cs
where stationId = 126 and time >='2024-08-28T15:11:00+08:00' and time <'2024-08-28T15:34:05+08:00'
group by sn,time(60s) fill(none)
)
Order by time desc LIMIT 10 OFFSET 0`

**Result**
![image](https://github.com/user-attachments/assets/ad3dbebd-0f93-41a7-b189-9e24f9dbdad7)

# Question:
1. sn=glcd05 and time = 2024-08-28T07:13:00Z,code=3030 Why is there no merging
2. the order is not desc

Contributor guide

Open the contributing guide

Research direction

No source files or tests are identified. Start by reproducing the supplied SQL query against InfluxDB 1.8 with the shown data, then investigate why the grouped result does not merge the reported row and why the outer ORDER BY time DESC is not reflected in the result.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.