MS SQL answer.
Re: How do I implement LastIndexOf functionality in SQLServer 2000?
[sql]
select case when charindex('12',s) =0 then 0 else length(s)-charindex(reverse('12'),reverse(s)) end as lastIndexOf, s from t;
[/sql]
The above was not tested.
The above finds the last index of '12' in column 's' of table 't'.
Hope this helps.
|