Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-field paging query (Original: 多字段分页查询) #977

Open
971120zyx opened this issue Jul 9, 2019 · 1 comment
Open

Multi-field paging query (Original: 多字段分页查询) #977

971120zyx opened this issue Jul 9, 2019 · 1 comment

Comments

@971120zyx
Copy link

971120zyx commented Jul 9, 2019

There are three fields, whether to call (1 is, 0 no), call time (timestamp Long) and add time (timestamp Long), now you need to query the paging data. It is necessary to find out the call status (value 1) in the front, and the non-call status (0). The call status is sorted in descending order by call time (Long type), and the non-calls are sorted in descending order by adding time (Long type).

Original:
有三个字段,是否呼叫(1是,0否),呼叫时间(时间戳Long)和添加时间(时间戳Long),现在需要查询分页数据。需要查出呼叫状态(值为1)的在前面,未呼叫状态(0)的再后面。呼叫状态的按呼叫时间(Long型)降序排序,没呼叫的按添加时间(Long型)降序排序。

@greenrobot-team greenrobot-team changed the title 多字段分页查询 Multi-field paging query (Original: 多字段分页查询) Jul 16, 2019
@greenrobot-team
Copy link
Collaborator

If I understand correctly what you want is like SQL GROUP BY? greenDAO is an opinionated library which sticks to an object relational mapping approach. Hence it does not support this directly.

However, there are workarounds.
https://stackoverflow.com/questions/40573541/how-to-use-group-by-in-greendao
#164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants