How to add a sequential row number column to an aggregate view.
Posted on 2010-04-02
I have a query that agrregates the values from a table in oracle. I want to add a column with sequential rownumbers and I get the following error:
"Ora-00979 Not a valid Group by expression."
It is trying to pull the row numbers from the source data. What I want is to have a squential id number colum.
COUNT (DISTINCT COVERPAGE_GIS.PARENT_COMPANY) COMPANIES,
FROM COVERPAGE_GIS, FORM477_PART_VI_GIS
WHERE (COVERPAGE_GIS.CONTROL_ID = FORM477_PART_VI_GIS.CONTROL_ID)
AND ( (FORM477_PART_VI_GIS.UPLOAD_RATE_CODE >= 2)
OR (FORM477_PART_VI_GIS.DOWNLOAD_RATE_CODE >= 2))
GROUP BY FORM477_PART_VI_GIS.TRACT_FIPS