Re: [sqlite] Multiple SELECTs in one call

2019-02-06 Thread Keith Medcalf
You mean something like select * from t where a in (select a from t where e != 1 union select a from t where d > 3 union SELECT a from t where c != 1 AND b != 1); or more succinctly: select * from t where a in (select a

Re: [sqlite] Multiple SELECTs in one call

2019-02-06 Thread Simon Slavin
On 7 Feb 2019, at 4:21am, Jose Isaias Cabrera wrote: > want to use the result of (SELECT a from t where e != 1); to run another > select (SELECT a from t where d > 3); and then, one more select (SELECT a > from t where c != 1 AND b != 1); How are these related to each other ? Do you want

[sqlite] Multiple SELECTs in one call

2019-02-06 Thread Jose Isaias Cabrera
Greetings. I need some help from you gurus to have multiple selects, but the sequence is important. For example, create table t (a, b, c, d, e); insert into t values (1,2,3,4,5); insert into t values (2,2,3,4,5); insert into t values (3,3,3,3,3); insert into t values (4,1,1,1,1); insert into

Re: [sqlite] GROUP BY and ICU collation

2019-02-06 Thread Richard Hipp
On 2/6/19, li...@herger.net wrote: > Hi there, > > I'm trying to create a list with an index list. Eg. I have artists: > > Sting > Šuma Čovjek > Suzanne Vega > > That's the sort order I'd get using an ICU collation. "Šuma Čovjek" > would be sorted as "Suma..." as expected. > > Now I'd like to

[sqlite] GROUP BY and ICU collation

2019-02-06 Thread lists
Hi there, I'm trying to create a list with an index list. Eg. I have artists: Sting Šuma Čovjek Suzanne Vega That's the sort order I'd get using an ICU collation. "Šuma Čovjek" would be sorted as "Suma..." as expected. Now I'd like to create an index bar by providing groups of the first

Re: [sqlite] Bug due to left join strength reduction optimization?

2019-02-06 Thread Richard Hipp
On 2/6/19, Danny wrote: > This has been fixed by revision d840e. Thanks for the quick response, drh! Just to be clear: Dan found the fix. I merely checked it in. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list

Re: [sqlite] Bug due to left join strength reduction optimization?

2019-02-06 Thread Danny
This has been fixed by revision d840e. Thanks for the quick response, drh! Danny ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Sqlite3: create a database from file using one line command-line script

2019-02-06 Thread Keith Medcalf
sqlite3 database.db < myscript.sql --- 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 kostasvgt >Sent:

Re: [sqlite] ISO8601 vs Numeric Timestamp for Date Storage

2019-02-06 Thread Keith Medcalf
On Wednesday, 6 February, 2019 12:55, Ben Asher wrote: > Hi there! We're having a debate at my company about date storage in > SQLite. SQLite has builtin support for ISO8601 in its date functions, > so some folks have started storing dates as ISO8601 SQLite-compatible > date strings. > Are

Re: [sqlite] ISO8601 vs Numeric Timestamp for Date Storage

2019-02-06 Thread Jens Alfke
> On Feb 6, 2019, at 2:21 PM, J Decker wrote: > > From a JS point of view new Date( ISOString )and .toISOString() are quick > and available…. Available, yes, but expensive (compared to using a number.) > ISO format parsing is NOT that hard it's just a minor varient of > parsing floats.

Re: [sqlite] ISO8601 vs Numeric Timestamp for Date Storage

2019-02-06 Thread J Decker
From a JS point of view new Date( ISOString )and .toISOString() are quick and available ISO format parsing is NOT that hard it's just a minor varient of parsing floats. (maybe the conversion from parts into numeric?) Haven't bothered to benchmark it. Date Diffs easily avaialble. On Wed,

Re: [sqlite] ISO8601 vs Numeric Timestamp for Date Storage

2019-02-06 Thread Jens Alfke
> On Feb 6, 2019, at 11:55 AM, Ben Asher wrote: > > Hi there! We're having a debate at my company about date storage in SQLite. > SQLite has builtin support for ISO8601 in its date functions, so some folks > have started storing dates as ISO8601 SQLite-compatible date strings. Are > there

Re: [sqlite] ISO8601 vs Numeric Timestamp for Date Storage

2019-02-06 Thread Andy Bennett
Hi, Integer unix timestamps are only accurate to one second, where ISO8601 (at least as implemented by SQLite) can go to 1 millisecond. Also you have to know the epoch to interpret a unix timestamp - not everybody uses 1970-01-01 00:00:00. Will people be able to figure out what the field

Re: [sqlite] ISO8601 vs Numeric Timestamp for Date Storage

2019-02-06 Thread Dennis Clarke
On 2/6/19 9:10 PM, Richard Hipp wrote: On 2/6/19, Ben Asher wrote: Hi there! We're having a debate at my company about date storage in SQLite. SQLite has builtin support for ISO8601 in its date functions, so some folks have started storing dates as ISO8601 SQLite-compatible date strings. Are

Re: [sqlite] ISO8601 vs Numeric Timestamp for Date Storage

2019-02-06 Thread Richard Hipp
On 2/6/19, Ben Asher wrote: > Hi there! We're having a debate at my company about date storage in SQLite. > SQLite has builtin support for ISO8601 in its date functions, so some folks > have started storing dates as ISO8601 SQLite-compatible date strings. Are > there pitfalls to storing dates

Re: [sqlite] Sqlite3: create a database from file using one line command-line script

2019-02-06 Thread Donald Griggs
sqlite3 myDatabase.db ".read myCommands.sql" On Wed, Feb 6, 2019 at 3:30 PM kostasvgt wrote: > Hi, I need to run a command to create a database and populate it from a > .sql file at once from command-line, not dot-commands. > Is there any way to do this in one line? > > Thanks. >

Re: [sqlite] ISO8601 vs Numeric Timestamp for Date Storage

2019-02-06 Thread Dennis Clarke
On 2/6/19 7:55 PM, Ben Asher wrote: Hi there! We're having a debate at my company about date storage in SQLite. SQLite has builtin support for ISO8601 in its date functions, so some folks have started storing dates as ISO8601 SQLite-compatible date strings. Are there pitfalls to storing dates

Re: [sqlite] althttpd.c CGI Script Requires a Throw Away First Line of Output?

2019-02-06 Thread Richard Hipp
On 2/5/19, Carl Chave wrote: > I'm experimenting with the althttpd.c web server. As a simple first test I > created a static html file and a lua script file. The static file displays > as expected in firefox. The lua file, which simply reads in the same > static html file and writes it back to

[sqlite] Sqlite3: create a database from file using one line command-line script

2019-02-06 Thread kostasvgt
Hi, I need to run a command to create a database and populate it from a .sql file at once from command-line, not dot-commands. Is there any way to do this in one line? Thanks. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

[sqlite] althttpd.c CGI Script Requires a Throw Away First Line of Output?

2019-02-06 Thread Carl Chave
I'm experimenting with the althttpd.c web server. As a simple first test I created a static html file and a lua script file. The static file displays as expected in firefox. The lua file, which simply reads in the same static html file and writes it back to stdout ends up being truncated and

[sqlite] ISO8601 vs Numeric Timestamp for Date Storage

2019-02-06 Thread Ben Asher
Hi there! We're having a debate at my company about date storage in SQLite. SQLite has builtin support for ISO8601 in its date functions, so some folks have started storing dates as ISO8601 SQLite-compatible date strings. Are there pitfalls to storing dates this way compared to a unix timestamp?

Re: [sqlite] Displaying hierarchical structure

2019-02-06 Thread Bart Smissaert
I can select the rank as in the previous e-mail with this recursive query: with recursive paths(id, folder, path) as (select id, folder, folder from folders where parent_id is null union select folders.id, folders.folder, paths.path || '-' || substr('0', length(folders.id)) ||

Re: [sqlite] Min/Max and skip-scan optimizations

2019-02-06 Thread R Smith
On 2019/02/06 12:12 AM, Gerlando Falauto wrote: The use case involves retaining as much data as the storage can possibly hold (so a bunch of gigabytes). I could've just used directories and logfiles instead of abusing a relational database but I just thought it would more convenient to issue