判断两个字段的值是否相等? sql表有ID TF D1 D2四个字段(D1,D2由任意数字组成)若D1值与D2值相等,则TF字段的值为2,反之为1如表所示ID TF D1 D2 1 1 10 20 2 2 5 5 3 1 7 84 2 9 9...如何写得出TF的程序 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 update tb set TF = 2 where D1 = D2update tb set TF = 2 where D1 <> D2 update t1 set tf=2 where D1 = D2 update t1 set tf=1 where D1 <> D2 --update tb set TF=case when D1=D2 then 2 else 1 end update tablea set TF=case when D1=D2 then 2 else 1 end update tablea set TF=case when D1=D2 then TF+1 else TF end update tb set TF=case when D1=D2 then 2 else 1 end update tablea set TF=case when D1=D2 then TF+1 else TF end 按照上面大家得方法出现错误:无法绑定由多个部分组成的标识符 "tb.D1"。如何解决 update tb set TF=TF+1 where D1=D2 无法绑定由多个部分组成的标识符 "tb.D1"。如何解决 运行代码,出现如下错误提示,为什么? sql查询语句的转换问题 各位老师,请问关于流水号的sql怎么写? oracle 创建服务后连接不稳定 请问:怎么模拟一个项目来实践一下? 数据复制过程中,提示Primary key 主键冲突!急!!! 如何将inert,update,delete操作写到一个触发器中? sql语句疑难(急) 关于触发器问题,不是很理解.. 访问windows server 2003环境下Sql Server 2000遭拒绝 怎么在存储过程得到当前时间并格式化成yyyyMMddHHmmssffff这样的? 求一天SQL语句
update tb set TF = 2 where D1 <> D2
update t1 set tf=2 where D1 = D2
update t1 set tf=1 where D1 <> D2
update tb set TF=case when D1=D2 then 2 else 1 end
update tablea set TF=case when D1=D2 then 2 else 1 end
update tablea set TF=case when D1=D2 then TF+1 else TF end