lundi 11 juillet 2016

MySQL: select all the data but if contains ' * ', then show the last four characters

Something like:

SELECT IF( [call_history.callerid contains '*'], [if it contains, keep last four char], [if not, return ' '(not null)] ) AS 'test'

FROM call_history

ORDER BY start DESC;

Aucun commentaire:

Enregistrer un commentaire