Re: [sqlite] Query has problems with string that looks like a number

2007-08-12 Thread Christopher Backhouse
OK, that fixes it on the commandline. Now to figure out how to link against the new version... Joe Wilson wrote: Time to upgrade. --- Christopher Backhouse <[EMAIL PROTECTED]> wrote: I repeated exactly what you have there and confirm it doesn't work for me. [EMAIL PROTECTED]:/tmp$ sqlite3 te

Re: [sqlite] Query has problems with string that looks like a number

2007-08-12 Thread Joe Wilson
Workaround for 3.3.13: select distinct bar, baz as z from foo where bar in (( select bar from foo where baz==z order by length(bar) desc limit 1 )); It's just different enough to prevent sqlite 3.3.13 from choking on the "order by" clause in the "in" subquery. --- Christopher Backhouse <[EM

Re: [sqlite] Query has problems with string that looks like a number

2007-08-12 Thread Joe Wilson
Time to upgrade. --- Christopher Backhouse <[EMAIL PROTECTED]> wrote: > I repeated exactly what you have there and confirm it doesn't work for me. > > [EMAIL PROTECTED]:/tmp$ sqlite3 testing > SQLite version 3.3.13 > Enter ".help" for instructions > sqlite> CREATE TABLE foo(bar text, baz text); >

Re: [sqlite] Query has problems with string that looks like a number

2007-08-12 Thread Christopher Backhouse
I repeated exactly what you have there and confirm it doesn't work for me. [EMAIL PROTECTED]:/tmp$ sqlite3 testing SQLite version 3.3.13 Enter ".help" for instructions sqlite> CREATE TABLE foo(bar text, baz text); sqlite> INSERT INTO "foo" VALUES('123','345'); sqlite> INSERT INTO "foo" VALUES('12

Re: [sqlite] Query has problems with string that looks like a number

2007-08-12 Thread Joe Wilson
--- Christopher Backhouse <[EMAIL PROTECTED]> wrote: > I have a table: > create table foo(bar text,baz text); > > I want to produce a list of all bar's paired with the longest baz they > are ever associated with. I came up with the following query: > > select distinct bar,baz as z from foo where