Re: [sqlite] Intersecting multiple queries

2020-02-28 Thread Hamish Allan
On Sat, 29 Feb 2020 at 00:45, Keith Medcalf wrote: > > In other words, why would one want to do: > > select * from data where uuid in (select uuid from data where twit == 1 > INTERSECT select uuid from data where twat == 1 INTERSECT select uuid from > data where lastname like 'cricket%'

Re: [sqlite] Intersecting multiple queries

2020-02-28 Thread Simon Slavin
On 29 Feb 2020, at 12:45am, Keith Medcalf wrote: > select * from data where (...) AND (...) AND (...) ; SELECT uuid FROM Data WHERE filter LIKE ? OR filter LIKE ? OR filter LIKE ? OR filter LIKE ? … would probably be an efficient way to do it if you could construct your

Re: [sqlite] Intersecting multiple queries

2020-02-28 Thread Keith Medcalf
Of course, you could just as well do: select * from data where (...) AND (...) AND (...) ; and do away with all the extraneous stuff. In other words, why would one want to do: select * from data where uuid in (select uuid from data where twit == 1 INTERSECT select uuid from data where twat

Re: [sqlite] Intersecting multiple queries

2020-02-28 Thread Keith Medcalf
select stuff from data where uuid in (select uuid from data where ... INTERSECT select uuid from data where ... INTERSECT select uuid from data where ... ); -- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original

Re: [sqlite] Intersecting multiple queries

2020-02-28 Thread Simon Slavin
On 28 Feb 2020, at 11:02pm, Hamish Allan wrote: > What I'm wondering is if there's a shortcut to avoid having to build the UUID > list in app code I would probably start by building a list of the search patterns then see what I could do with it: (pattern1,pattern2,pattern3) Would a Common

[sqlite] Intersecting multiple queries

2020-02-28 Thread Hamish Allan
Hi, I am building a list of UUIDs from multiple queries of the form: SELECT uuid FROM Data WHERE filter LIKE ? with a different bound parameter each time. In app-space code, I'm getting the results of these queries and intersecting them, so that the final list contains only UUIDs returned by

Re: [sqlite] After column add, what should be done to update the schema?

2020-02-28 Thread Lee Gray
I just tried it in v5.3.5.470 and v5.3.5.472 and it worked fine. From: sqlite-users On Behalf Of Andy KU7T Sent: Thursday, February 27, 2020 6:03 PM To: SQLite mailing list Subject: [sqlite] After column add, what should be done to update the schema? Hi, I use a simple ALTER TABLE ADD COLUMN

Re: [sqlite] After column add, what should be done to update the schema?

2020-02-28 Thread David Raymond
"I read somewhere that the DDL is really just a copy of the text when teh table was created" It starts that way, but the ALTER TABLE command will update that string when it runs so that it reflects the new column. Did you commit your changes after the alter table and before looking for the