SELECT DISTINCT
OU_CODE, EMP_ID AS EMP_CODE, EMP_TYPE_ID AS EMP_TYPE, T_FIRST_NAME AS EMP_NAME_THA, T_LAST_NAME AS EMP_LASTNAME_THA,
E_FIRST_NAME AS EMP_NAME_ENG, E_LAST_NAME AS EMP_LASTNAME_ENG, DIVISION_ID AS DIV_CODE, TURNOVER_DATE AS RESIGN_DATE,
EMP_STATUS, PRE_NAME_ID, LEFT(DIVISION_ID, 2) AS FAC_CODE, JOB_TYPE
FROM OPENQUERY(HSODBC1, 'select * from gb_employee where emp_status = 01') AS derivedtbl_1
ตรงคำสั่ง Code
FROM OPENQUERY(HSODBC1, 'select * from gb_employee where emp_status = 01') AS derivedtbl_1