mysql和oracle的delete from

 这期需要将oracle迁移到mysql,所以,会将dao层的工程都换成mysql的写法。

以前的写法:

@Delete("delete from test t where t.ID=#{id}")
void del(long id);

delete from test t where t.ID=#{id} 在oracle中是ok的,但是在mysql中,是报错的。需要将它改为:

delete from test  where  ID=#{id}  或者是 delete t.* from test t where t.ID=#{id}

发布了261 篇原创文章 · 获赞 174 · 访问量 61万+

猜你喜欢

转载自blog.csdn.net/u013047824/article/details/102957343