ที่เจออันแรกครับ
select department from kskdepartment where (department_active <> "N" or department_active is null) order by department
จาก table
CREATE TABLE `kskdepartment` (
`depcode` char(3) NOT NULL DEFAULT '',
`department` varchar(150) DEFAULT NULL,
`roomno` varchar(5) DEFAULT NULL,
`doctor_code` varchar(7) DEFAULT NULL,
`online_time` datetime DEFAULT NULL,
`on_desk` char(1) DEFAULT NULL,
`spclty` char(2) DEFAULT NULL,
`screen_visible` char(1) DEFAULT NULL,
`doctor_visible` char(1) DEFAULT NULL,
`registry_visible` char(1) DEFAULT NULL,
`rx_visible` char(1) DEFAULT NULL,
`status_open` char(1) DEFAULT NULL,
`cashier_visible` char(1) DEFAULT NULL,
`medication_check` char(1) DEFAULT NULL,
`can_print_sticker` char(1) DEFAULT NULL,
`depcode_active` char(1) DEFAULT NULL,
`hospital_department_id` int(11) DEFAULT NULL,
`print_sticker_check` char(1) DEFAULT NULL,
`ot_service_pay` char(1) DEFAULT NULL,
`hos_guid` varchar(38) DEFAULT NULL,
`oldcode` varchar(3) DEFAULT NULL,
`dep_confirm_code` varchar(10) DEFAULT NULL,
`ipd_visible` char(1) DEFAULT NULL,
PRIMARY KEY (`depcode`),
KEY `ix_department` (`department`),
KEY `ix_online_time` (`online_time`),
KEY `ix_hos_guid` (`hos_guid`)
) ENGINE=InnoDB DEFAULT CHARSET=tis620
แสดงว่าโครงสร้างตารางผมไม่ถูกใช่ใหมครับ อ.