DB2的 部分SQL语句

场景1:主键在清空表之后不会回到1开始

 

ALTER TABLE T_GPS_UPLOAD ALTER COLUMN ID RESTART WITH 1


场景2:清空表中的所有内容,

TRUNCATE TABLE T_GPS_UPLOAD IMMEDIATE;

场景3:查询分页

select * from (
select a.* , rownumber() over(order by id ) as rowid from (" +
select * from T_VERSION where VERSION_NO " +
like ‘%‘ || #{versionNo} ||‘%‘ AND VERSION_TYPE like ‘%‘ || #{versionType} ||‘%‘)" +
a) tmp where tmp.rowid <= #{pageOneParam} and tmp.rowid > #{pageTwoParam}

DB2的 部分SQL语句

上一篇:Windows下的mysql5.7.*压缩包安装教程


下一篇:oracle字符集AL32UTF8