Re: [sqlite] length() behaviors on Mac osx

2009-10-16 Thread Michael Chen
yes, you are right. I'd better to go to sleep now -:) On Fri, Oct 16, 2009 at 2:23 AM, P Kishor wrote: > On Fri, Oct 16, 2009 at 1:42 AM, Michael Chen > wrote: > > select *, (length(path) - length( replace(path, '/','' )) +1 ) > > sqlite>

Re: [sqlite] length() behaviors on Mac osx

2009-10-16 Thread P Kishor
On Fri, Oct 16, 2009 at 1:42 AM, Michael Chen wrote: > select *, (length(path) - length( replace(path, '/','' )) +1 ) sqlite> SELECT length('/1/2/5/'); 7 sqlite> SELECT replace('/1/2/5/', '/', ''); 125 sqlite> SELECT length('125'); 3 7 - 3 = 4 4 + 1 = 5 sqlite>

[sqlite] length() behaviors on Mac osx

2009-10-16 Thread Michael Chen
I just downloaded the source file and build it on my Mac osx 10.6, and it seems problematic: create table tree ( idinteger primary key, parent_id integer references tree, data text, path text-- materialized path ); -- compute depth of a node