-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Invalid query when ORDER BY with DISTINCT #85
Labels
Milestone
Comments
Thanks. I'll ponder this for a little while (busy getting version 4 out) and then have another look. |
Fixed in 4.0.1 |
rbygrave
pushed a commit
that referenced
this issue
Mar 17, 2023
* FIX: DB.json().toBean(target) can update existing lists * remove sys.print, typo --------- Co-authored-by: Roland Praml <[email protected]> Co-authored-by: Juri Skrobko <[email protected]>
rbygrave
added a commit
that referenced
this issue
Mar 17, 2023
FIX: DB.json().toBean(target) can update existing lists (#85)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I create Qurey with "order by" for example:
@Test
public void orderByWithoutLimit() {
db.createQuery(QueueJob.class).setDistinct(true).orderBy(QueueJob.USER+"."+User.USERNAME).findList();
}
which gives SQL Query something like this:
select distinct t0.id as c0, t0.file_id as c1, t0.file_name as c2, t0.driver_id as c3, t0.file_hash as c4, t0.user_id as c5, t0.job_id as c6 from queue_jobs t0 left outer join users t1 on t1.id = t0.user_id order by t1.username
limit 11
I got error from database (PosgreSQL, H2, Microsoft SQL Server; there is no error in mySQL) that "order by" property must be in select list:
I think that in such cases the order by field should be added to select columns list.
The text was updated successfully, but these errors were encountered: