我是一名SQL新手,我非常感谢在这个相当基本的问题上提供的一些帮助。SQL错误:无效的标识符
select comp_table.*
from (select column_1,avg(column_2) as "avg"
from table_1, group by column_1) comp_table
→返回正确的记录2列名为column_1
和avg
但如果我更改为:
select comp_table.avg
from (select column_1,avg(column_2) as "avg"
from table_1, group by column_1) comp_table
→回报错误:无效的标识符 “平均”
事情是我只需要选择avg
列,所以我不能做select comp_table.*
。你们能帮忙吗?
此外,如果您可以提供一些调整技巧的查询,这将是很棒的。
@John Kugelman:→不错! – egrunin 2010-09-17 04:29:16
这样的声音是[ORA-00904:无效标识符](http://www.dba-oracle.com/t_ora_00904_string_invalid_identifier.htm)... – 2010-09-17 04:48:10