Update sql to remove spaces
See the query and output below:. You can see, the spaces from the right side of the string are removed while the result is still showing the gap from the left side. The TRIM function removes spaces from both sides of the string:. Practically, you will require removing the spaces from the table columns data. Source: stackoverflow.
Add a Grepper Answer. The duplicate key value is 2. I had the same problem after extracting data from excel file using ETL and finaly i found solution there :. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. Asked 8 years, 11 months ago. Active 1 year, 11 months ago. Viewed k times. All data in this column has trailing spaces. I want to remove all those, and I want to have the data without any trailing spaces.
Improve this question. Litisqe Kumar 2, 4 4 gold badges 24 24 silver badges 38 38 bronze badges. Add a comment. Our database has a table named company with data in two columns: id and name. Alternatively, you can use the shorter version without the FROM keyword and space as characters to remove; by default, TRIM will treat this as removing spaces from a string stored in a given column or expression in argument of TRIM function.
Use the TRIM function if you want to trim a string in a table.
0コメント