Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Keith Medcalf
sers [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Edson Poderoso >Sent: Monday, 3 September, 2018 07:32 >To: sqlite-users@mailinglists.sqlite.org >Subject: [sqlite] Incorrect result when using WHERE with with >correlated sub-select query > >Using t

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Richard Hipp
On 9/3/18, Edson Poderoso wrote: > WHERE outerr.spent = (SELECT spent ...) The "spent" column holds a floating-point number. Depending on the order of operations, the values might be off by an epsilon, resulting in different floating point values and a failed comparison. This is why you should

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread David Raymond
37.62 Run Time: real 0.015 user 0.00 sys 0.015600 sqlite> -Original Message- From: David Raymond Sent: Wednesday, September 05, 2018 10:10 AM To: SQLite mailing list Subject: RE: [sqlite] Incorrect result when using WHERE with with correlated sub-select query From the downloa

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread David Raymond
real 0.032 user 0.00 sys 0.00 sqlite> -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Edson Poderoso Sent: Monday, September 03, 2018 9:32 AM To: sqlite-users@mailinglists.sqlite.org Subject: [sqlite] Incorrect result

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Richard Hipp
On 9/3/18, Edson Poderoso wrote: > Using the chinook database available at: > https://github.com/lerocha/chinook-database > > The following query should return 26 rows, instead I returns 15. How do you know that the correct answer is 26 rows instead of 15? I tried to download the SQLite and

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Keith Medcalf
@mailinglists.sqlite.org] On Behalf Of Edson Poderoso >Sent: Monday, 3 September, 2018 07:32 >To: sqlite-users@mailinglists.sqlite.org >Subject: [sqlite] Incorrect result when using WHERE with with >correlated sub-select query > >Using the chinook database available at: >

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Simon Slavin
On 3 Sep 2018, at 2:32pm, Edson Poderoso wrote: > The following query should return 26 rows, instead I returns 15. Which version of SQLite ? Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

[sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Edson Poderoso
Using the chinook database available at: https://github.com/lerocha/chinook-database The following query should return 26 rows, instead I returns 15. WITH GbC AS ( SELECT c.Country, c.CustomerId, SUM(i.total) spent FROM Customer c JOIN Invoice i ON i.CustomerId = c.CustomerId GROUP BY 1, 2),