SELECT
s.time AS TIME,
'tts投诉' AS sugesstWall,
r.region_name AS courseName,
c.center_name AS centerName,
cr.class_name AS className,
tscc.course_name AS courseName,
stu.true_name AS studentName,
stu.phone AS studentPhone,
CASE s.flag
WHEN 0 THEN '投诉'
WHEN 1 THEN '建议'
ELSE '表扬'
END AS flag ,
st.type_name AS type_name,
s.obj_name AS obj_name,
dep.dept_name AS deptName,
tel.name AS titleName,
s.content AS content
FROM
suggest s
LEFT JOIN center c ON c.center_id = s.center_id
LEFT JOIN city ON city.city_id=c.city_id
LEFT JOIN region r ON city.region_id=r.region_id
LEFT JOIN suggest_type st ON st.type_id = s.suggest_type
LEFT JOIN student stu ON s.student_id=stu.student_id
LEFT JOIN classroom cr ON stu.class_id=cr.class_id
LEFT JOIN series_class sc ON sc.series_class_id = cr.series_class_id
LEFT JOIN tsc_course tscc ON sc.course_id = tscc.course_id
LEFT JOIN employee e ON e.employee_id=s.obj_id
LEFT JOIN dept dep ON e.dept_id=dep.dept_id
LEFT JOIN title tel ON tel.title_id=e.title_id
WHERE 1=1
AND s.time >= '2016-09-01 00:00:00'
AND s.time < '2016-10-01 00:00:00'
sql 查询结果if else
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...