li yuqian <[EMAIL PROTECTED]> wrote:
> 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 :-(
This statement works for me without any errors. Try upgrading to a more
recent version of SQLite. If for some reason you can't, try replacing
substr(t.variable,5)
with
substr(t.variable,5, length(t.variable) - 4)
and similarly for the other occurence of substr.
''||'off' is equivalent to simply 'off' (concatenating anything to an
empty string doesn't change that anything).
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users