Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将包含国家/地区的 Excel 工作表导入到数据库表中。
不幸的是,所有行都有一些前导空白。
那么,我怎样才能删除这些空白呢?
这将删除前导和尾随空格
Update tablename set fieldName = ltrim(rtrim(fieldName));
某些版本的 SQL 支持
Update tablename set fieldName = trim(fieldName);
如果您只想删除前导
update tablename set fieldName = LTRIM(fieldName);