We have created a awesome theme
Far far away,behind the word mountains, far from the countries

INFO ½ÇÀü DB¸ðµ¨¸µ°ú SQL°úÁ¤

INFO

½ÇÀü DB¸ðµ¨¸µ°ú SQL°úÁ¤
Á¶È¸¼ö 4036
Á¦¸ñ Chapter7_ÆäÀÌ¡ó¸® : ¿¹Á¦¸ðÀ½
ÀÛ¼ºÀÚ °ü¸®ÀÚ
ÀÛ¼ºÀÏÀÚ 2021-12-03

¡á[SQL 7_1_1] Total ·¹ÄÚµå ¼ö SELECT
SELECT  COUNT(*) totcnt
FROM  INSA_BBS
WHERE  BBS_CODE = #bbsCode#;



¡á[SQL 7_1_2] °Ô½ÃÆÇ ½ÃÀÛ ÆäÀÌÁö¿Í CountperPage ÀÔ·Â
SELECT A.BBS_CODE bbsCode,
         A.BBS_SEQ bbsSeq,
         A.TITLE title,
  A.CONTENT content,
  A.ID id ,
      A.PW pw ,
      A.BBS_DATE bbsDate ,
      A.HIT_CNT hitCnt ,
  A.NAME name
FROM INSA_BBS A
WHERE 1=1____
AND A.BBS_CODE = #bbsCode#
ORDER BY BBS_SEQ DESC
LIMIT #firstIndex#, #pageUnit#;



¡á¿¹ 7_2_1  ||  ´ë¿ë·® DBÀÇ ÆäÀÌ¡ ó¸®1
SELECT BBS_SEQ, TITLE, NAME, WRITE_DATE, HIT_CNT
FROM  BOARD
WHERE BBS_SEQ > :T_BBS_SEQ
AND ROWNUM <= 10
AND :SW  = 'D'
UNION
SELECT /*+ INDEX_DESC(BOARD BOARD _PK) */
BBS_SEQ, TITLE, NAME, WRITE_DATE, HIT_CNT
FROM BOARD
WHERE BBS_SEQ < :F_BBS_SEQ
AND ROWNUM <= 10
AND :SW  = 'U';



¡á¿¹ 7_2_2  ||  ´ë¿ë·® DBÀÇ ÆäÀÌ¡ ó¸®2
SELECT SABUN, NAME, HP, YEARS, SEX, CARRIER, POS_GBN_CODE, ADDR1||ADDR2, PUT_YN
FROM  INSA
WHERE SABUN > :T_SA

÷ºÎÆÄÀÏ