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