question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

duplicate results in queries

See original GitHub issue

I have more than one condition like

myObjectBox.query()
.equal(MyObject_.relatedObjectId, 1)
.less(MyObject_.date, date)
.build().findIds()

on a object collection like

{id, relatedObjectId, date}
{1,1,2017-05-20},
{2,1,2017-05-21},
{3,1,2017-05-22},
{4,1,2017-05-23},

with date {2017-05-22} (including some time) i get the following result {1,2,3,1}

Why the hell is there a 1? I tried “life” on a debugger with an additional comparison to the relatedObject and got the result {1,1,2,3} - still not the thing i want to get. If I try to order them I get the error, that I just can use this option on unordered requests. That is strange and think its an issue. If I am wrong, tell me what I do wrong (the code is nearly a copy with some anonymizing of the variables)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
smith6kcommented, Aug 27, 2017

I can confirm that this solved my issues of having duplicates in results.

0reactions
greenrobotcommented, Nov 13, 2017

Did not come up again, so I assume this is fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are there duplicates in the query results and how to ...
To minimize the appearance of duplicate rows in the query results: · Limit the number of output fields, especially one-to-many fields, such as...
Read more >
How to Find Duplicate Values in SQL - LearnSQL.com
Using the GROUP BY clause to group all rows by the target column(s) – i.e. the column(s) you want to check for duplicate...
Read more >
Debugging duplicated data in SQL query results - Metabase
What to do when your query returns data with duplicated rows or columns. · Option 1: Use an INNER JOIN with a one-to-many...
Read more >
How to Find Duplicate Values in a SQL Table - Chartio
This tutorial will teach you how to find these duplicate rows. To follow along, you'll need read access to your database and a...
Read more >
An Intro to Resolving Duplicate Results in SQL Queries
My first attempt to remove the duplicates was to add the DISTINCT keyword to my query, but that didn't fix the problem –...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found