Hi Igor, we want porting the FreePBX(freepbx.org) to our project www.astfin.org, Actually i don't know this substr(t.value,1,0) means :-(
now i try follow sql SELECT t.variable, t.value, ifnull(d.value, ''||'off') state FROM globals t LEFT JOIN globals d ON (substr(t.variable,5) = substr(d.variable,12) and t.variable LIKE 'OUT\_%' ESCAPE '\' and d.variable LIKE 'OUTDISABLE\_%' ESCAPE '\') ORDER BY t.variable; and get a SQL error: wrong number of arguments to function substr(), still not get working :-( Thanks, 2008/2/12, Igor Tandetnik <[EMAIL PROTECTED]>: > > "li yuqian" <[EMAIL PROTECTED]> wrote in > message > news:[EMAIL PROTECTED] > > i follow the documents for sqlite function and change the sql to: > > ----------- > > SELECT t.variable, t.value, ifnull(d.value, > > group_concat(substr(t.value,1,0),'off')) > > state FROM globals t LEFT JOIN globals d ON (substr(t.variable,5) = > > substr( d.variable,12) and t.variable LIKE 'OUT\_%' ESCAPE '\' and > > d.variable LIKE 'OUTDISABLE\_%' ESCAPE '\') ORDER BY t.variable; > > --------- > > always get SQL error: no such function: group_concat, but the sqlite > > documents have this function! > > group_concat is an aggregate function (like max and such), so it's not > what you need anyway. It's probably new in some version of SQLite later > than the one you have. > > SQLite doesn't have concat() function, but has concatenation operator || > (two pipe characters). So simply replace concat(a, b) with a || b > > I'm still pretty sure that substr(t.value,1,0) always returns an empty > string, so you could just as well write '' (two single quotes). I > suspect you meant to do something different, but it's not clear what. > > Igor Tandetnik > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Li YuQian Your Astfin team ___________________________________ uClinux/Asterisk distribution for Blackfin CPU http://www.ucpbx.com http://astfin.org http://sourceforge.net/projects/astfin/ ___________________________________ _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users