三种数据库的SQL差异

修改表名和字段长度

==mysql==
alter table api_user change column oldCName newCName varchar(500);
alter table api_user modify column 字段名 varchar(500);

==oracle==
alter table tableName rename column oldCName to newCName
alter table t_test_role modify(字段名 varchar(255));

==sqlserver==
alter table Table1 alter colunm 字段名 varchar(255)
alter table tablename alter colunm oldCName newCName varchar(255)

分页

======mysql==========
select * from tableName limit (page-1)*pageSize,pageSize

======oracle=========
select *
from
(
select rownum rn, a.*
from (select * from tableName order by creTime) a
where rownum <= page*pageSize
) b
where b.rn > (page-1)*pageSize;

======sqlserver=========
select top pageSize *
from
(
select row_number() over (order by id) as rownumber,* from tableName 
) as a
where rownumber > (page-1)*pageSize

 

posted @ 2018-05-07 12:59  静赋清承  阅读(195)  评论(0编辑  收藏  举报