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 <[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);
> sqlite> INSERT INTO "foo" VALUES('123','345');
> sqlite> INSERT INTO "foo" VALUES('123','6789');
> sqlite> INSERT INTO "foo" VALUES('23456','13');
> sqlite> INSERT INTO "foo" VALUES('432','13');
> sqlite> INSERT INTO "foo" VALUES('7654321','13');
> sqlite> INSERT INTO "foo" VALUES('1234567','345');
> sqlite> select * from foo;
> 123|345
> 123|6789
> 23456|13
> 432|13
> 7654321|13
> 1234567|345
> sqlite> 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);
> sqlite> .q
____________________________________________________________________________________
Shape Yahoo! in your own image. Join our Network Research Panel today!
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------