Search Postgresql Archives

Re: problem with query and group by error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I tried distinct on srs.scan_run_id, which is a primary key, and got an error, but I tried it again just now, and it worked fine.

Thanks for having me try it again.

I had ended up with
   group by srs.scan_run_id, sty.scan_type, ssn.scan_system_name, ssn.simulation, ssitenames.scan_site_name,
   ssitenames.scan_site_name, ssitenicknames.scan_site_nickname,
   hvhi.hardware_version_or_hardware_identifier_name, sv.software_version, sc.description

because I kept adding column names that I got errors on, but this is by no means the whole list.  So, I'm still confused as to why I got the error in the first place.

Someone said something about
 "Yes, except those that are inside the aggregate."
but I don't have an aggregate specified.

Susan



On Fri, Feb 21, 2014 at 10:38 AM, Scott Marlowe <scott.marlowe@xxxxxxxxx> wrote:
On Fri, Feb 21, 2014 at 10:40 AM, Susan Cassidy
<susan.cassidy@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> I originally had the query without the group by, but I had duplicate rows,
> so I added a group by to eliminate them.


Have you tried select distinct or select distinct on ()?


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux