Mysql, Concat on specified length -


i trying find way in mysql functions the following:

'ssssssttttttttrrrriiiinnnngggg' // have string 

i want take 10 letters concate '...'(3 dots), want concat strings on 10 letters example:

'123456string' // result: '123456stri...' 'strin6' // result: 'strin6' 'str123456ing' // result: 'str123456i...' 'asd23456' // result: 'asd23456' 

i trying substr, lpad , concat combinations, if got correct functions combination thankful, thank , have nice day.

  select case when length(mystring) <= 10        mystring    else        concat(left(mystring, 7), '...')    end mycol   ... 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -