| | |
How to remove extra spaces in a row??
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2008
Posts: 28
Reputation:
Solved Threads: 0
Hi,
I have a table like this:
I want to remove extra space i.e in between binding and protein, desired and location, useful and this.
I tried with trim function but that didn't remove these spaces.
There should be only one space in between binding and protein, desired and location, useful and this.
Output should be like this:
How can i remove extra spaces???
Any suggestions??
Regards
Vanditha
I have a table like this:
MySQL Syntax (Toggle Plain Text)
name +------------------------------------+ | name | +------------------------------------+ | This IS an rna-binding protein. The data which IS useful IS available FROM the desired location. | +------------------------------------+ 1 row IN SET (0.00 sec)
I want to remove extra space i.e in between binding and protein, desired and location, useful and this.
I tried with trim function but that didn't remove these spaces.
There should be only one space in between binding and protein, desired and location, useful and this.
Output should be like this:
MySQL Syntax (Toggle Plain Text)
SELECT * FROM remove; +--------------------------------+ | name | +--------------------------------+ | This IS an rna-binding protein. The data which IS useful IS available FROM the desired location | +--------------------------------+ 1 row IN SET (0.00 sec)
How can i remove extra spaces???
Any suggestions??
Regards
Vanditha
Last edited by Vandithar; Jun 2nd, 2009 at 6:41 am.
•
•
Join Date: Aug 2008
Posts: 28
Reputation:
Solved Threads: 0
•
•
•
•
Hi,
Could you copy and paste your code? Have you used any css?
Thanks
Hi,
I am not using css!
This is the data i.e in my table.
MySQL Syntax (Toggle Plain Text)
name +------------------------------------+ | name | +------------------------------------+ | This IS an rna-binding protein. The data which IS useful IS available FROM the desired location. | +------------------------------------+ 1 row IN SET (0.00 sec)
I tried with trim function like this:
MySQL Syntax (Toggle Plain Text)
UPDATE remove SET name = TRIM(name);
but didn't work!!!
How can i remove these spaces??
Regards
Vanditha
•
•
Join Date: Apr 2009
Posts: 11
Reputation:
Solved Threads: 0
•
•
•
•
Hi,
I am not using css!
This is the data i.e in my table.
MySQL Syntax (Toggle Plain Text)
name +------------------------------------+ | name | +------------------------------------+ | This IS an rna-binding protein. The data which IS useful IS available FROM the desired location. | +------------------------------------+ 1 row IN SET (0.00 sec)
I tried with trim function like this:
MySQL Syntax (Toggle Plain Text)
UPDATE remove SET name = TRIM(name);
but didn't work!!!
How can i remove these spaces??
Regards
Vanditha
Hi Vanditha
you are right when u used the trim it's not worked because trim is used only when the white space in left side or right side. so use regexp for this issue.
Regards
Saurav Prasad
•
•
•
•
Could you copy and paste your code? Have you used any css?
•
•
•
•
so use regexp for this issue.
@OP : Use the REPLACE function in MySQL.
http://dev.mysql.com/doc/refman/5.0/en/replace.html
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
![]() |
Similar Threads
- remove extra blank spaces in a text file (C++)
- Using isspace with white spaces (C++)
- trying to remove extra white spaces in data file (IT Professionals' Lounge)
- This ought to be simple - extra spaces (PHP)
Other Threads in the MySQL Forum
- Previous Thread: SQL Query Help Required
- Next Thread: MySQL Importable file required for country and state
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





