[sqlite] Tricky grouping query

2010-10-01 Thread Andy Chambers
Given the following create table events ( id, date, status ); insert into events values ('001','a','N'); insert into events values ('001','b','N'); insert into events values ('001','c','Y'); insert into events values ('001','d','N'); insert into events values ('001','e','Y'); insert into

Re: [sqlite] Vertical -> Horizontal transformation

2010-09-29 Thread Andy Chambers
On Wed, Sep 29, 2010 at 6:16 PM, Petite Abeille wrote: > > On Sep 29, 2010, at 7:05 PM, Simon Slavin wrote: > >> SQL (not just SQLite) is traditionally terribly bad at doing matrix >> inversions.  What do you want to use the wide short table for ?  Does it >> really

[sqlite] Vertical -> Horizontal transformation

2010-09-29 Thread Andy Chambers
Hi, I've got a nice normalized table and need to produce a de-normalized view of this table (i.e. convert it from tall skinny, into wide short table). In order to do this, I was planning on just joining the table to itself for each "value" that needs to be turned into a column. However, it

[sqlite] Distinct Bug

2010-08-13 Thread Andy Chambers
values ('1', '2', 'e'); insert into t_distinct_bug values ('1', '3', 'f'); select a from (select distinct a, b from t_distinct_bug) => 1 I'd have thought it should return 1 1 1 I'm on SQLite 3.6.22 -- ---- Andy Chambers Formedix

[sqlite] Version compatibility

2010-07-23 Thread Andy Chambers
Hi, I've been reading about version compatibility between different versions of sqlite at the link below: http://www.sqlite.org/formatchng.html It states the expected behaviour for old and new with a different first number, and a different second number, but not a different third number. I

[sqlite] maximum length for a column name

2008-09-22 Thread Andy Chambers
Hi, I've checked the "Limits in sqlite" page and don't see any limits to tablenames or columnnames. Does that mean there isn't any? (or at least they're only limited by the maximum length of a sql statement). Cheers, Andy ___ sqlite-users mailing list

[sqlite] vertical -> horizontal data conversion

2008-09-04 Thread Andy Chambers
Hi, I have a table like this create table clinical_data ( group_def text, item_def text, value text ); Assuming this example data... GROUP_DEF, ITEM_DEF, VALUE --- "MEDHIST", "BODSYS", "foo" "MEDHIST", "TERM", "bar" "MEDHIST", "ONSET",

[sqlite] Segfault with deeply nested views

2007-01-26 Thread Andy Chambers
Hi List, I've found a situation which causes sqlite to segfault. System Info - OS: Debian Etch Sqlite Version: 3.3.8 Run the sql listed below to see segfault. I'd be interested to hear of a workaround if anybody knows of one. Of course, I'll post to the list if I find one.

[sqlite] Segfault when querying deeply nested view

2007-01-26 Thread Andy Chambers
Hi List, I've found a situation which causes sqlite to segfault. System Info - OS: Debian Etch Sqlite Version: 3.3.8 Run the attached sql script to see segfault. I'd be interested to hear of a workaround if anybody knows of one. Of course, I'll post to the list if I find one.