mysql removing characters from end of value
Here’s a quick MySQL trick a co-worker helped me figure out today. This roughly equates to PHPs substr($var,0,-2) functionality.
1
| SUBSTRING(field, 1, (LENGTH(field) - 2)) |
So if the fields value was 12345xx this would change the returned value to 12345.
This entry was posted
on Thursday, December 4th, 2008 at 11:35 pm and is filed under SQL.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.