Re: [sqlite] Can SQLite do this in a single query?

2019-10-25 Thread Winfried
Keith Medcalf wrote > Well, "paint" is to draw your output. Thank you. -- Sent from: http://sqlite.1065341.n5.nabble.com/ ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Can SQLite do this in a single query?

2019-10-24 Thread Keith Medcalf
essage- >From: sqlite-users On >Behalf Of Winfried >Sent: Thursday, 24 October, 2019 17:11 >To: sqlite-users@mailinglists.sqlite.org >Subject: Re: [sqlite] Can SQLite do this in a single query? > >Simon Slavin-3 wrote >> https://sqlite.org/books.html > >Thanks

Re: [sqlite] Can SQLite do this in a single query?

2019-10-24 Thread Winfried
Simon Slavin-3 wrote > https://sqlite.org/books.html Thanks. "You have to paint the output table yourself." "You still have to "paint the fence" yourself, though now the table data is not sparse, thus easier to paint" Looks like "paint" is DB lingo: Does it mean formatting the output after

Re: [sqlite] Can SQLite do this in a single query?

2019-10-24 Thread Simon Slavin
On 24 Oct 2019, at 10:18am, Winfried wrote: > Is there a good book you would recommend to learn about SQLite, especially > regarding SELECT? A list already made: Books long and short, concentrating on different things. You might also be interested in books

Re: [sqlite] Can SQLite do this in a single query?

2019-10-24 Thread Winfried
Thank you very much to all. There's no way I could have come up with those queries. Considering the wealth/complexity of SELECT even in SQLite, it seems a whole book could be written on just that command. https://www.sqlite.org/images/syntax/select-stmt.gif Is there a good book you would

Re: [sqlite] Can SQLite do this in a single query?

2019-10-22 Thread Keith Medcalf
On Tuesday, 22 October, 2019 23:24, Doug wrote: >Please explain one phrase in the select: > total(1) over (partition by city_txt, mode_txt) >Is "total" a function and does "1" refer to city_txt? >I can't wrap my head around what's going on with this phrase. total() is a built-in aggregate

Re: [sqlite] Can SQLite do this in a single query?

2019-10-22 Thread Doug
t; On Behalf Of Keith Medcalf > Sent: Tuesday, October 22, 2019 7:11 AM > To: SQLite mailing list > Subject: Re: [sqlite] Can SQLite do this in a single query? > > CREATE TABLE employees(employee_id, city_id, mode_id); > CREATE TABLE citys(city_id, city_txt); > CREATE TABL

Re: [sqlite] Can SQLite do this in a single query?

2019-10-22 Thread Keith Medcalf
n >Behalf Of Keith Medcalf >Sent: Tuesday, 22 October, 2019 09:44 >To: SQLite mailing list >Subject: Re: [sqlite] Can SQLite do this in a single query? > > >Hmmm. That gives the wrong answers compared to doing it the "old >fashioned way". You still have to "pa

Re: [sqlite] Can SQLite do this in a single query?

2019-10-22 Thread Keith Medcalf
a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users On >Behalf Of Keith Medcalf >Sent: Tuesday, 22 October, 2019 08:11 >To: SQLite mailing list >Subject: Re: [sqlite] Can SQLite do this in a single query? > >CREATE T

Re: [sqlite] Can SQLite do this in a single query?

2019-10-22 Thread David Raymond
but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users On >Behalf Of Winfried >Sent: Tuesday, 22 October, 2019 07:23 >To: sqlite-users@mailinglists.sqlite.org >Subject: Re: [sqlite] Can SQLite do this in a singl

Re: [sqlite] Can SQLite do this in a single query?

2019-10-22 Thread Keith Medcalf
a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users On >Behalf Of Winfried >Sent: Tuesday, 22 October, 2019 07:23 >To: sqlite-users@mailinglists.sqlite.org >Subject: Re: [sqlite] Can SQLite do this in a single query? > >Yes, I f

Re: [sqlite] Can SQLite do this in a single query?

2019-10-22 Thread Petr Jakeš
> Yes, I forgot the column mode_id in the Employee's table. > > Thanks, I'll read up on the features SQLite's SELECT has to offer. At > worst, > I'll just run a simpler query multiple times. > Will the results of simple query multiple times help you somehow? Think about how to join two or more

Re: [sqlite] Can SQLite do this in a single query?

2019-10-22 Thread Winfried
Yes, I forgot the column mode_id in the Employee's table. Thanks, I'll read up on the features SQLite's SELECT has to offer. At worst, I'll just run a simpler query multiple times. https://www.sqlite.org/lang_select.html -- Sent from: http://sqlite.1065341.n5.nabble.com/

Re: [sqlite] Can SQLite do this in a single query?

2019-10-21 Thread Bart Smissaert
> Not a clue. I didn't write the schema. I know, I asked the OP. RBS On Mon, Oct 21, 2019 at 4:16 PM Keith Medcalf wrote: > > On Monday, 21 October, 2019 08:47, Bart Smissaert < > bart.smissa...@gmail.com> wrote: > > >Shouldn't there be field MODE_ID in the Employee table? > > Not a clue. I

Re: [sqlite] Can SQLite do this in a single query?

2019-10-21 Thread Keith Medcalf
On Monday, 21 October, 2019 08:47, Bart Smissaert wrote: >Shouldn't there be field MODE_ID in the Employee table? Not a clue. I didn't write the schema. Perhaps there is another table called MODATES that has a link to the employee (EMPLOYEE_ID) and a link to the mode (MODE_ID) together

Re: [sqlite] Can SQLite do this in a single query?

2019-10-21 Thread Petr Jakeš
> Shouldn't there be field MODE_ID in the Employee table? > It looks like a high school homework to me :D ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Can SQLite do this in a single query?

2019-10-21 Thread Bart Smissaert
Shouldn't there be field MODE_ID in the Employee table? RBS On Mon, Oct 21, 2019 at 3:44 PM Keith Medcalf wrote: > > On Monday, 21 October, 2019 08:31, Winfried wrote: > > >Using the following tables, I need to find how employees from each city > >come to work. > > >== Employees table: >

Re: [sqlite] Can SQLite do this in a single query?

2019-10-21 Thread Keith Medcalf
On Monday, 21 October, 2019 08:31, Winfried wrote: >Using the following tables, I need to find how employees from each city >come to work. >== Employees table: >EMPLOYEE_ID | CITY_ID >Cities table: >CITY_ID | CITY_TXT >Mode table: >MODE_ID | MODE_TXT > >This is the type of output I need to