공지사항

  • home
  • 커뮤니티
  • 공지사항
select * from ( select *, (select count(*) from tb_board_cmt where use_tableName='tb_board_content' and b_sq = tmp1.b_sq) as cmt_cnt from (select ROW_NUMBER() OVER(ORDER BY org_b_w_date desc , org_b_sq desc , reply_sort) as row_num, (select b_cate_name from tb_board_cate cate WHERE cate.b_code = content.b_code AND cate.b_cate_sq = content.b_cate_sq) as cate,b_sq, b_code, b_cate_sq, w_date, dbo.fn_datetime2str(w_date, 'yyyy.mm.dd') as w_date_view, subjects, contents, usr_sq, usr_name, 0 as reply_depth, is_secret, hit, is_notice, etc1, etc2, etc3, etc4, etc5 from tb_board_content content where is_notice=1 and b_code=12 ) tmp1 union all select *, (select count(*) from tb_board_cmt where use_tableName='tb_board_content' and b_sq = tmp2.b_sq) as cmt_cnt from (select ROW_NUMBER() OVER(ORDER BY org_b_w_date desc , org_b_sq desc , reply_sort) as row_num, (select b_cate_name from tb_board_cate cate WHERE cate.b_code = content.b_code AND cate.b_cate_sq = content.b_cate_sq) as cate,b_sq, b_code, b_cate_sq, w_date, dbo.fn_datetime2str(w_date, 'yyyy.mm.dd') as w_date_view, subjects, contents, usr_sq, usr_name, reply_depth, is_secret, hit, is_notice, etc1, etc2, etc3, etc4, etc5 from tb_board_content content where 1=1 and b_code=12 ) tmp2 where row_num between 51 and 60 and is_notice<>1) tmp_result order by is_notice desc, row_num
검색
  • english
  • twitter
  • facebook
  • blog
  • instagram