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.
我需要搜索并更新我的数据库以获取以空格开头的列值..
SQL
UPDATE table SET column substring(column, 1) WHERE column has blankspace
我怎样才能做到这一点?
编辑 哦,是的。 原因是删除空格...
使用LTRIM()函数删除起始空格。
尝试这个:
UPDATE table SET column = LTRIM(column)
我认为你应该明确并使用like:
like
UPDATE table SET column = substring(column, 1) WHERE column like ' %';