Notice
Recent Posts
Recent Comments
Link
SeouliteLab
페이지 나누기 오라클 -> MySQL & MariaDB 본문
오라클 일때
SELECT no,subject,name,dbday,hit,num
FROM (SELECT no,subject,name,TO_CHAR(regdate, 'YYYY-MM-DD') as dbday,hit,rownum as num
FROM (SELECT no,subject,name,regdate,hit
FROM board ORDER BY no DESC))
WHERE num BETWEEN 1 AND 10;
MySQL & MariaDB 일때
SELECT no,subject,name,dbday,hit,num
FROM(SELECT @RNUM := @RNUM + 1 AS num, a.*
FROM (SELECT no,subject,name,DATE_FORMAT(regdate, '%Y-%m-%d') as dbday,hit FROM board) a, ( SELECT @RNUM := 0 ) b)c
WHERE c.num BETWEEN 1 AND 10
ORDER BY no DESC;
Oracle MySQL & MariaDB
SYSDATE NOW()
TO_CHAR(regdate, 'YYYY-MM-DD') DATE_FORMAT(regdate, '%Y-%m-%d')
'프로그래밍' 카테고리의 다른 글
HTTP 1.1 Keep-Alive 기능에 대해 (0) | 2017.05.22 |
---|---|
윈도우 서비스 등록,삭제,시작,중지,조회 (0) | 2017.05.22 |
iBatis란 (0) | 2016.01.20 |
POJO(Plain Old Java Object) (0) | 2016.01.20 |
스프링 컨테이너와 IOC 개념 (0) | 2016.01.20 |