IT/개발
oracle sql
카앙구운
2015. 9. 25. 09:00
728x90
반응형
2. 서브 게시판 테이블
(1) 테이블 생성(고유번호,한줄내용, 패스워드, 글쓴이,등록일, 본문 고유번호)
create table subBoard(
unq number(9) not null,
pwd varchar2(20) not null,
name varchar2(10),
comm varchar2(100),
rdate timestamp,
cUnq number(9)
);
select unq,title,writer,rdate,(select count(*) from subBoard where cUnq=a.unq) subCnt from (select rownum rm,unq,title, writer,rdate from (select unq,title,writer,rdate from board order by unq desc)) a where rm between 1 and 5;
728x90
반응형