日期:2014-05-18 浏览次数:20574 次
SELECT *, ( CASE com.company_type WHEN '1' THEN (SELECT name, FROM sgperson WHERE id = com.person_id) WHEN '2' THEN (SELECT name FROM jlperson WHERE id = com.person_id) WHEN '3' THEN (SELECT name FROM jcperson WHERE id = com.person_id) WHEN '5' THEN (SELECT name FROM sjperson WHERE id = com.person_id) END ) pic, ( CASE com.company_type WHEN '1' THEN (SELECT tel1 FROM sgperson WHERE id = com.person_id) WHEN '2' THEN (SELECT tel1 FROM jlperson WHERE id = com.person_id) WHEN '4' THEN (SELECT tel1 FROM jcperson WHERE id = com.person_id) WHEN '5' THEN (SELECT tel1 FROM sjperson WHERE id = com.person_id) END ) tel1, ( CASE com.company_type WHEN '1' THEN (SELECT tel2 FROM sgperson WHERE id = com.person_id) WHEN '2' THEN (SELECT tel2 FROM jlperson WHERE id = com.person_id) WHEN '4' THEN (SELECT tel2 FROM jcperson WHERE id = com.person_id) WHEN '5' THEN (SELECT tel2 FROM sjperson WHERE id = com.person_id) END ) tel2 FROM com_project com, userg [user] WHERE project_id = 'AA325552' AND deptid = company_id AND com.attend_id LIKE '%,KT365688,%'