problem with group-by clause/aggreate functions

Поиск
Список
Период
Сортировка
От Shabala Deshpande
Тема problem with group-by clause/aggreate functions
Дата
Msg-id 16b7e2640809090244m3668c7c0kbbdb2f92e0800621@mail.gmail.com
обсуждение исходный текст
Ответы Re: problem with group-by clause/aggreate functions  (Bastiaan Olij <lists@basenlily.nl>)
Список pgsql-novice
hi,
 
I am having a problem with group-by clause/aggreate functions... Following is the query which runs well in mysql....
 
query :

select min(rt), cnt, link_name, dir, t_rate, rate from fg_table where obj_type = ? and obj_id = ? and rt > ? and rt_type = 'u' group by link_name, dir;

but when i run it in postgres i get follwing errors:
 
DBD::Pg::st execute failed: ERROR:  column "fg_table.cnt" must appear in the GROUP BY clause or be used in an aggregate function 
 
same for the t_rate,rate  fields in SELECT clause which are not included in the GROUP BY clause.
 
 
can anyone please guide me?
 
thanks n regards,
..shabala

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Григорий Никоноров"
Дата:
Сообщение: Re: Problem wth postgresql.conf
Следующее
От: Bastiaan Olij
Дата:
Сообщение: Re: problem with group-by clause/aggreate functions