问题描述
嗨
我使用以下查询从我的专栏中删除最后一个
更新Table_Name set Column_Name =(选择左(Column_Name,LEN(Column_Name)-1)作为Lat
来自Table_Name a其中Column_Name如'%N')其中Column_Name如'%N'
它给出以下错误
请帮助我。
& lt; pre lang =& quot; xml& quot;& gt;消息512,级别16,状态1,行1
子查询返回的值超过1。当子查询遵循=,!=,& amp; lt;,& amp; lt; =,& amp; gt;,& amp; gt; =或子查询用作以下子查询时,不允许这样做表达。
该声明已被终止。& lt; / pre& gt;< / pre>
hi
I am using following query for remove last latter from my column
update Table_Name set Column_Name=(select left(Column_Name,LEN(Column_Name)-1) as Lat
from Table_Name a where Column_Name like '%N') where Column_Name like '%N'
it gives an following Error
Please Help me.
<pre lang="xml">Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , &gt;, &gt;= or when the subquery is used as an expression.
The statement has been terminated.</pre></pre>
推荐答案
UPDATE Table_name SET Column_Name = LEFT(Column_Name, LEN(Column_Name) - 1)
WHERE Column_Name LIKE '%N'
错过了_[/ edit]
[edit]Missed out a "_"[/edit]
这篇关于如何替换我的专栏的最后一个字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!