> Just a note:
> select distinct substr(col, length(?1), 1)
> should be
> select distinct substr(col, length(?1) + 1, 1)

Oh, yes, sure. I always mix 0-based and 1-based indexing of symbols in
different languages. :)

Pavel

On Tue, Aug 25, 2009 at 11:50 AM, Mohit Sindhwani<m...@onghu.com> wrote:
> Pavel Ivanov wrote:
>> Maybe you want something like this:
>>
>> select distinct substr(col, length(?1), 1)
>> from table
>> where col like ?1||'%'
>>
>>
> Hi Pavel, thanks!  It works..!
> Just a note:
> select distinct substr(col, length(?1), 1)
> should be
> select distinct substr(col, length(?1) + 1, 1)
>
> So, for the sample data earlier, it should be:
> select distinct substr(str, 3, 1) from items where str like "IT%";
>  and
> select distinct substr(str, 4, 1) from items where str like "ITS%";
>
> Thanks,
> Mohit.
>
> _______________________________________________
> 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