Is there a way to TRIM all data in a SELECT * FROM statement?
问题 I am trying to select and trim all the entries from a table using the following statement: SELECT TRIM(*) FROM TABLE But I get an error. Is there a way to return all entries selected so they are trimmed for blank characters at the beginning and end of each string? 回答1: You need to specify each string column by hand: SELECT TRIM(col1), --LTRIM(RTRIM(...)) If RDBMS is SQL Server TRIM(col2), TRIM(col3), TRIM(col4) -- ... FROM table There is another problem with your proposal. * is placeholder