How to retrieve the last 4 characters from a mysql database field?

In order to be able to simulate substr from PHP and mysql, I want to do something like

select * from table where last_four_chars(field) = '.png'


The docs have an example directly relevant to this.

select * from table where SUBSTRING(field, -4) = '.png'

With RIGHT function :

SELECT RIGHT('abcdefg', 3);
-- efg

You can achieve the same result with SUBSTRING :

SELECT SUBSTRING('abcdefg', -3);
-- efg

This Fast query:

Select * from table where picName like '%.png'

SELECT * FROM table WHERE SUBSTRING( field, -4 ) = '.png'

Need Your Help

What is the best way to hide the screen while knockout js bindings are being built?

javascript mvvm knockout.js

I'm a huge knockoutjs fan. I use it for all my web development now and simply love it. One thing that I've not been able to figure out though is how to hide the UI while the knockoutjs bindings are...

LaTeX table too wide. How to make it fit?

latex tabular

I just started to learn latex and now I'm trying to create a table. This is my code: