Bug #2051 | INSTRREV / LASTINDEXOF | ||
---|---|---|---|
Submitted: | 8 Dec 2003 16:24 | Modified: | 10 Dec 2005 17:20 |
Reporter: | Arjen Lentz | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S4 (Feature request) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[8 Dec 2003 16:24]
Arjen Lentz
[27 Nov 2005 12:12]
Valeriy Kravchuk
Thank you for a feature request. Please, check the SUBSTRING_INDEX(str,delim,count) function already implemented (read http://dev.mysql.com/doc/refman/5.0/en/string-functions.html for details). I think it can be used to implement a kind of search you are looking for.
[28 Nov 2005 2:47]
Arjen Lentz
No, SUBSTRING_INDEX() can merely return either everything before a certain position or after a certain position. The original feature request was about *searching* a string from the end rather the start.
[10 Dec 2005 17:20]
Valeriy Kravchuk
The following workaround may be simpler (2 function calls only), but I agree, that it will be a useful feature to have for some kinds of string processing. mysql> select instr("The string to, search!", substring_index("The string to, se arch!", ",", -1)) - 1 col; +-----+ | col | +-----+ | 14 | +-----+ 1 row in set (0.00 sec)