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.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
"Yes, except those that are inside the aggregate."
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 ()?