mysql - Delete characters if the row size more than 9-characters -


i have more 12000 rows in sql table , want delete exceed characters row if contains more 9 character.

before:

id----title 1-----great day summer 

after:

id----title 1-----great day 

use substring first 9 characters.

update tablename set title = substring(title,1,9) 

you can add clause make sure long values updated, keep transaction size down:

update tablename set title = substring(title,1,9) length(title) > 9 

(is length mysql?)


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -