"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

Reply via email to