Thorsten Lockert wrote: >SELECT *, LENGTH(code) >FROM a >WHERE code = left('00442085673456', LENGTH(code)) >ORDER BY LENGTH(code) DESC >LIMIT 1; > Awesome, thanks Thorsten..