现在的位置: 首页 > 综合 > 正文

delete from inner join 的使用

2013年11月14日 ⁄ 综合 ⁄ 共 422字 ⁄ 字号 评论关闭

以前只用到过update a set a.pwd=b.pwd from a inner join b on a.id=b.id
所以想当然就认为delete from a inner join b on a.id=b.id
就是感觉别扭,gg了一下才知道语法错了
sql server下应该这么写
    delete from a from a inner join b on a.id=b.id

而Access中写为
    delete from a inner join b on a.id=b.id

update 语句也不同
    Access
        update  a inner join b on a.id=b.id set a.pwd=b.pwd 
   
   SQL Server

        update a set a.pwd=b.pwd from a inner join b on a.id=b.id

http://www.blogjava.net/ciyuanlong/archive/2009/07/31/289227.html

抱歉!评论已关闭.