Re: [sqlite] How to get aggregate without reducing number of rows (repeats are ok)?

2019-02-17 Thread Keith Medcalf
create table coaches (coach_name text); create table players ( playerName text not null, salary integer, fk_coach text, constraint abc foreign key (fk_coach) references coaches (coach_name) ); create table matches ( playedAgainst text not null,

Re: [sqlite] How to get aggregate without reducing number of rows (repeats are ok)?

2019-02-17 Thread Rocky Ji
@Keith Thanks. I am new to SQL and DB in general; please clarify what *is it valid* means. How do I check validity of schema? On Mon, Feb 18, 2019, 1:17 AM Keith Medcalf > Nice schema. Do you have a valid one? > > > --- > The fact that there's a Highway to Hell but only a Stairway to Heaven

Re: [sqlite] How to get aggregate without reducing number of rows (repeats are ok)?

2019-02-17 Thread Rocky Ji
@Luuk that was my initial approach. But everyone advices against nested select statements. Can we do it without that sub-query? On Sun, Feb 17, 2019, 11:04 PM Luuk > On 17-2-2019 17:46, Rocky Ji wrote: > > Hello everyone, > > > > How can I prevent group by clause from reducing the number of

Re: [sqlite] ON CONFLICT with partial indexes

2019-02-17 Thread Richard Hipp
On 2/17/19, Charles Leifer wrote: > I'm having trouble executing an INSERT ... ON CONFLICT with a partial > index. It works fine in the SQLite shell, but it fails when I express the > conflict constraint using a parameterized query. > > For example: > > CREATE TABLE ukvp ("id" integer primary

Re: [sqlite] ON CONFLICT with partial indexes

2019-02-17 Thread Charles Leifer
Olivier, what do you mean "snapshot"? What is a release? How can I find out about the SQLite "releases" you are talking about? On Sun, Feb 17, 2019 at 3:23 PM Olivier Mascia wrote: > > Le 17 févr. 2019 à 22:05, Charles Leifer a écrit : > > > > I run against the latest and greatest. > > > >

Re: [sqlite] ON CONFLICT with partial indexes

2019-02-17 Thread Olivier Mascia
> Le 17 févr. 2019 à 22:05, Charles Leifer a écrit : > > I run against the latest and greatest. > > Python: > > In [1]: import sqlite3 > > In [2]: sqlite3.sqlite_version > Out[2]: '3.28.0' > > > Sqlite: > > sqlite> select sqlite_version(), sqlite_source_id(); > 3.28.0|2019-02-12 22:58:32 >

Re: [sqlite] ON CONFLICT with partial indexes

2019-02-17 Thread Charles Leifer
I run against the latest and greatest. Python: In [1]: import sqlite3 In [2]: sqlite3.sqlite_version Out[2]: '3.28.0' Sqlite: sqlite> select sqlite_version(), sqlite_source_id(); 3.28.0|2019-02-12 22:58:32 167b91df77fff1a84791f6ab5f72239b90475475be690a838248119b6dd312f0 On Sun, Feb 17,

Re: [sqlite] ON CONFLICT with partial indexes

2019-02-17 Thread Simon Slavin
On 17 Feb 2019, at 8:51pm, Charles Leifer wrote: > Is this a bug? Just to make things easier, which version of SQLite are you using in your Python SQLite library ? If you don't know, you can find this out using SELECT sqlite_version(); SELECT sqlite_source_id(); The second may give

[sqlite] ON CONFLICT with partial indexes

2019-02-17 Thread Charles Leifer
I'm having trouble executing an INSERT ... ON CONFLICT with a partial index. It works fine in the SQLite shell, but it fails when I express the conflict constraint using a parameterized query. For example: CREATE TABLE ukvp ("id" integer primary key, "key" text not null, "value" int not null,

Re: [sqlite] How to get aggregate without reducing number of rows (repeats are ok)?

2019-02-17 Thread Keith Medcalf
Nice schema. Do you have a valid one? --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Rocky Ji >Sent:

Re: [sqlite] How to get aggregate without reducing number of rows (repeats are ok)?

2019-02-17 Thread Luuk
On 17-2-2019 17:46, Rocky Ji wrote: Hello everyone, How can I prevent group by clause from reducing the number of rows without affecting accuracy of what aggregate functions provide? Scenario: My club has-many coaches. Each coach trains a team of players. Of course, a player has-many matches

[sqlite] How to get aggregate without reducing number of rows (repeats are ok)?

2019-02-17 Thread Rocky Ji
Hello everyone, How can I prevent group by clause from reducing the number of rows without affecting accuracy of what aggregate functions provide? Scenario: My club has-many coaches. Each coach trains a team of players. Of course, a player has-many matches and a match has-many players. Given the