2021-10-25

Oracle分页SQL


```java
 SELECT
            *
        FROM
            (
                SELECT
                    item.*,
                    ROWNUM ROW_ID
                FROM
                    (
                        SELECT
                            *
                        FROM
                            TB_ITEM
                        WHERE
                             ( updatetime >= TO_DATE(#{lastTime}, 'yyyy-mm-dd hh24:mi:ss' ) AND updatetime <= TO_DATE( #{currentTime}, 'yyyy-mm-dd hh24:mi:ss' ) )
                    ) item
                WHERE
                    ROWNUM <= 1000
            )
        WHERE
            ROW_ID > 0
    </select>

上一篇:springboot输出最终sql


下一篇:SQL Server字符串转日期格式