Jason wrote: > select target, avg(reaction_time) from data_table GROUP BY target; > > That should do it. > > -Jason. > Wow! That works great. Thanks Jason. It's interesting that "select target, avg(reaction_time) from data_table GROUP BY target;" works but not "select target, avg(reaction_time) from data_table;". Doesn't the parser automatically group by the first variable returned? -Tony
G. Anthony Reina writes:
> It's interesting that "select target, avg(reaction_time) from data_table
> GROUP BY target;" works but not "select target, avg(reaction_time) from
> data_table;".
>
> Doesn't the parser automatically group by the first variable returned?
The parser really doesn't know much about all of this. While you might
have a point that
select field1, aggregate(field2) from table
doesn't have any other useful interpretation than an implied group by
field1, it's probably too much work to support such a non-SQL construct.
--
Peter Eisentraut Sernanders väg 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера