Click here to Skip to main content
15,905,504 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
there are lesson codes in my mysql database column but some lesson code has space in the middle how to clear this space


for ex MATH 207 must be MATH207

but I must do in sql string Select ....(lesson_code) from lessons .......

there is trim rtrim ltrim replace but I didnt find which one I can use....
Posted

1 solution

This should work,

SELECT replace(YOUR COLUMN, ' ','') FROM YourTable
 
Share this answer
 
v2
Comments
Member-2338430 8-Mar-13 15:22pm    
thanks alot run
DinoRondelly 8-Mar-13 15:23pm    
No problem glad to help
Member-2338430 8-Mar-13 15:25pm    
ok if lesson code any special character how to delete of them...
MATH-207 MATH_207 ETC.
DinoRondelly 8-Mar-13 15:26pm    
Read through this,

http://stackoverflow.com/questions/1580017/how-to-replace-multiple-characters-in-sql

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900