0
select
s.id, s.description, s.improvement, s.previous_year_id,
s.current_year_id, s.first_name, s.last_name, s.username,
s.finding, s.action, s.share, s.learned, s.timestamp,
d.title as department_title,
group_concat(g.title SEPARATOR \' | \') as strategic_goals,
y1.year as current_year_title, y2.year as previous_year_title,
u.summary_id, u.file_name as file_name
from
summary s, year y1, year y2, strategic_goal_entries sge,
goal g, department d, uploads u
where
s.id = sge.summary_id
and
s.current_year_id = y1.id
and
s.previous_year_id = y2.id
and
sge.goal_id = g.id
and
s.id = u.summary_id
and
s.department_id = d.id
and
s.department_id = '4'
group by
s.id
從具有在上傳表中有關記錄包含上傳內的值彙總表(s.id = uploads.summary_id)僅返回記錄.summary_id字段僅返回記錄時s.id = u.summary_id
我想返回所有記錄,不管它是否有與之關聯的文件。
任何幫助表示讚賞。
左加入上傳表.... – 2011-04-14 18:33:21