【发布时间】:2010-12-26 07:34:09
【问题描述】:
我正在尝试使用 join,但遇到了这个问题。我已经粘贴了我的查询
select count(*) from table_a inner
join table_b on table_a.number = table_b.number
left outer join table_c on table_a.id = table_c.id
and table_a.number = table_c.number
order by number;
请告诉我查询中有什么问题...
-维诺德
【问题讨论】:
-
唯一奇怪的是 order by - 所有三个表都有该列,但您的查询只会返回一行。
-
number 是一个保留字,所以如果这实际上是您正在使用的列名,我并不奇怪它会混淆。
-
那是正确的,加里!我认为“数字”将是上下文的。他必须使用引号->“NUMBER”来逃避它。并且 order-by 部分既不起作用也不需要。