[Spring
Data JPA,Querydsl강좌]오라클SQL조인,ROWNUM,OracleGrammar.rownum
아래 두가지 방법 모드 가능하다.
// List<Tuple> rows = queryFactory.select(myemp1.ename, mydept1.dname)
// .from(myemp1).innerJoin(mydept1)
// .on(myemp1.deptno.eq(mydept1.deptno)).limit(5).fetch();
List<Tuple> rows = queryFactory.select(myemp1.ename, mydept1.dname)
.from(myemp1).innerJoin(mydept1)
.on(myemp1.deptno.eq(mydept1.deptno))
.where(OracleGrammar.rownum.lt(6)).fetch();
-------------------------------------------------
select MYEMP1.ENAME, MYDEPT1.DNAME
from MYEMP1 MYEMP1
inner join MYDEPT1 MYDEPT1
on MYEMP1.DEPTNO = MYDEPT1.DEPTNO
where rownum < 6
아래 두가지 방법 모드 가능하다.
// List<Tuple> rows = queryFactory.select(myemp1.ename, mydept1.dname)
// .from(myemp1).innerJoin(mydept1)
// .on(myemp1.deptno.eq(mydept1.deptno)).limit(5).fetch();
List<Tuple> rows = queryFactory.select(myemp1.ename, mydept1.dname)
.from(myemp1).innerJoin(mydept1)
.on(myemp1.deptno.eq(mydept1.deptno))
.where(OracleGrammar.rownum.lt(6)).fetch();
-------------------------------------------------
select MYEMP1.ENAME, MYDEPT1.DNAME
from MYEMP1 MYEMP1
inner join MYDEPT1 MYDEPT1
on MYEMP1.DEPTNO = MYDEPT1.DEPTNO
where rownum < 6
댓글 없음:
댓글 쓰기