首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

这句sql语句该如何写

2012-01-15 
这句sql语句该怎么写?update Hname as a,Hjit as b set a.Hzsnamewangxi,a.Hzhenjian513822198610018

这句sql语句该怎么写?
update Hname as a,Hjit as b set a.Hzsname='wangxi',a.Hzhenjian='513822198610018832',a.Hemail='156436856@qq.com',a.Hdizhi='成都市温江区',a.Htel='13658020806',b.HJshouru='金卡手机费',b.HJshourulaiyuan='抢劫',b.HJname='呵呵',b.HJtel='26291478',b.HJguanxi='亲密',b.HJzhuzhi='四川眉山',b.HJyoubian='262914' where a.Id=b.Id and a.Id=1

[解决办法]
where Id=b.Id and a.Id=1
改成 where a.Id=b.Id and a.Id=1

[解决办法]
分开写:

SQL code
update Hname  set Hzsname='wangxi'    ,Hzhenjian='513822198610018832'    ,Hemail='156436856@qq.com'     ,Hdizhi='成都市温江区'     ,Htel='13658020806'from Hname  a ,Hjit  bwhere a.Id=b.Id and a.Id=1update Hjit set HJshouru='金卡手机费'    ,HJshourulaiyuan='抢劫'    ,HJname='呵呵'    ,HJtel='26291478'    ,HJguanxi='亲密'     ,HJzhuzhi='四川眉山'     ,HJyoubian='262914'     from Hname  a ,Hjit  bwhere a.Id=b.Id and a.Id=1
[解决办法]
探讨
update Hname
set Hzsname='wangxi'
,Hzhenjian='513822198610018832'
,Hemail='156436856@qq.com'
,Hdizhi='成都市温江区'
,Htel='13658020806'
from Hname a ,Hjit b
where a.Id=b.Id and a.Id=1

update Hjit
set HJshouru='金卡手机费'
,HJshourulaiyuan='抢劫'
,HJname='呵呵'
,HJtel='26291478'
,HJguanxi='亲密'
,HJzhuzhi='四川眉山'
,HJyoubian='262914'
from Hname a ,Hjit b
where a.Id=b.Id and a.Id=1

[解决办法]
SQL code
用update Hname set Hzsname='wangxi',Hzhenjian='513822198610018832',Hemail='156436856@qq.com',Hdizhi='成都市温江区',Htel='13658020806'from Hname as a,Hjit as b where a.Id=b.Id and a.Id=1update Hjit set HJshouru='金卡手机费',HJshourulaiyuan='抢劫',HJname='呵呵',HJtel='26291478',HJguanxi='亲密',HJzhuzhi='四川眉山',HJyoubian='262914' from Hname as a,Hjit as b where a.Id=b.Id and a.Id=1
[解决办法]
发现个成都的

热点排行