Oracle适配到sqlServer数据库需要修改的语法

1.sysdate 替换为 GETDATE()

2.NVL() 替换为ISNULL()

3.分页语法

4.concat换成+

5.to_date函数 and datediff(dd,#{params.beginTime},oper_time) >= 0

6.dual:删除 dual, 对象名 'DUAL' 在sqlServer中无效

7.batchUserPost 批量插入脚本修改 如下例
insert into sys_user_post(user_id, post_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.postId})
</foreach>

8.decode()语法改成 case when 语法,如下例:

decode(rent_type,0,'待租','已租') as lease_status
case rent_type
when '0' then '待租'
else '已租' end as lease_status,

9.Oracle中的序列可以修改为sqlServer表结构中的主键自增,如下图

 

posted @   小小野生程序员sunny  阅读(153)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
点击右上角即可分享
微信分享提示