Hi,

this is the expected behaviour.

See http://www.sqlite.org/lang_corefunc.html

"The ltrim(X,Y) function returns a string formed by removing any and all 
characters that appear in Y from the left side of X. If the Y argument 
is omitted, ltrim(X) removes spaces from the left side of X. "

The second argument is not a string but a set of characters. ltrim() 
strips leading zeros if you include a zero anywhere in your second 
argunent. This is the case in the first two examples.

Martin

Am 13.01.2011 14:41, schrieb Thilo Jeremias:
> Hi,
> the following seems wrong to me:
>
> bash-4.0# sqlite3
> SQLite version 3.6.14.2
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
>
>
> sqlite>  select ltrim("12300567","1230");
> 567
> sqlite>  select ltrim("012300567","0123");
> 567
> sqlite>  select ltrim("12300567","123");
> 00567
> sqlite>
>
>
> Is the stripping of leading 0's intentional?
> (or a bug in my netbsd port?)
>
> How can I workaround this problem?
>
>
> cheers thilo
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to