接任务,赚取用不完的金币中国教程网
《Photoshop专家讲堂》光盘热售
参与论坛活动,快速赚取金币精品素材,中英文字体
发新话题
打印

SQL语句简单问

SQL语句简单问


问下,有两张表,偶想有A中的一个字段是用A的一字段减去B中的一字段得到,为什么这样写不行呢?  

update  text2  a,text1  b  set  a.w=a.q-b.sd  
数据格式都是varchar,请帮偶看看,谢谢  
---------------------------------------------------------------  

update  text2    set  text2.w=text2.q-test1.sd  where  text1.id=text2.id  

---------------------------------------------------------------  

update  text2    from  text1  set  text2.w=text2.q-test1.sd  where  text1.id=text2.id  
---------------------------------------------------------------  

update  table1  set  
   a  =  (select  table1.c-b.d  from  table2  b  where  table1.id=b.id)  
---------------------------------------------------------------  

update  text2    set  text2.w=text2.q-test1.sd  from  text1  where  text1.id=text2.id
发新话题 返回列表