SELECT STDG_CD, CTPV_NM, SGG_NM, STTY_EMD_NM, STLI_NM, MTN_YN, LOTNO_MNO, LOTNO_SNO, ROAD_NM_CD, ROAD_NM, UDGD_YN, BMNO, BSNO, BDRG_BLDG_NM, DTL_BLDG_NM, BLDG_MNG_NO, EMD_SN, DONG_CD, DONG_NM, ZIP, ZIP_SN, BULK_DLDTN_NM, MVMN_RSN_CD, ANCMNT_YMD, CHG_BFR_ROAD_NM_ADDR, SGG_BLDG_NM, APTCPX_YN, BSCS_ZONE_NO, DADDR_YN, RMRK1, RMRK2, TRANSFER_YN, TRANSFER_DATE FROM ( SELECT STDG_CD, CTPV_NM, SGG_NM, STTY_EMD_NM, STLI_NM, MTN_YN, LOTNO_MNO, LOTNO_SNO, ROAD_NM_CD, ROAD_NM, UDGD_YN, BMNO, BSNO, BDRG_BLDG_NM, DTL_BLDG_NM, BLDG_MNG_NO, EMD_SN, DONG_CD, DONG_NM, ZIP, ZIP_SN, BULK_DLDTN_NM, MVMN_RSN_CD, ANCMNT_YMD, CHG_BFR_ROAD_NM_ADDR, SGG_BLDG_NM, APTCPX_YN, BSCS_ZONE_NO, DADDR_YN, RMRK1, RMRK2, TRANSFER_YN, TRANSFER_DATE , ROW_NUMBER() OVER (ORDER BY BLDG_MNG_NO) AS R_NUM FROM TTO_BD WHERE 1 = 1 AND TRANSFER_YN = 'N' ) WHERE R_NUM BETWEEN 1 AND 100
UPDATE TTO_BD SET TRANSFER_YN = 'Y' , TRANSFER_DATE = SYSDATE WHERE 1 = 1 AND BLDG_MNG_NO IN ( SELECT BLDG_MNG_NO FROM ( SELECT STDG_CD, CTPV_NM, SGG_NM, STTY_EMD_NM, STLI_NM, MTN_YN, LOTNO_MNO, LOTNO_SNO, ROAD_NM_CD, ROAD_NM, UDGD_YN, BMNO, BSNO, BDRG_BLDG_NM, DTL_BLDG_NM, BLDG_MNG_NO, EMD_SN, DONG_CD, DONG_NM, ZIP, ZIP_SN, BULK_DLDTN_NM, MVMN_RSN_CD, ANCMNT_YMD, CHG_BFR_ROAD_NM_ADDR, SGG_BLDG_NM, APTCPX_YN, BSCS_ZONE_NO, DADDR_YN, RMRK1, RMRK2, TRANSFER_YN, TRANSFER_DATE , ROW_NUMBER() OVER (ORDER BY BLDG_MNG_NO) AS R_NUM FROM TTO_BD WHERE 1 = 1 AND TRANSFER_YN = 'N' ) WHERE R_NUM BETWEEN 1 AND 100 )