access 表中关联表查询问题
table1
字段 id theme FileId MemoId
数据 1 x1 1 2
数据 2 x2 3 0
table2
字段 id style info
数据 1 file info1
数据 2 memo info2
数据 3 file info3
想要查询后显示下面信息
table1.id table1.theme table2.info table2.info
1 x1 info1 info2
2 x2 info3 (空)
我现在sql语句是这么写的:
select
a.id, a.theme, b.info, c.info
form
table1 a left join table2 b on a.fileid = b.id
left join
table2 c on a.memoid = c.id
但有问题。该怎么写呢?