SELECT idx as 'adidx', adcompanyname as 'adsponsorname', adtype1 as 'adtype', adphone as 'adphone'
FROM TBL_ADVERTISING_MEMBER
union all
SELECT '0' as 'adidx', pubname as 'adsponsorname',
( SELECT SESE_NAME FROM tbl_addtel_upjong where sese_code = ATB.Yp) as 'adtype',
( AreaCode + '-' + TelKuk + '-' + TelNo ) as 'adphone'
FROM TBL_ADDTELBOOK AS ATB
)
select * from
( select ADIDX, ADSPONSORNAME, ADTYPE, ADPHONE,row_number() over ( order by ADSPONSORNAME asc ) as 'ROWNUMBER'
from APP_CUSTOM
) as a where ROWNUMBER < 100
Posted by 홍반장