How to select row number in postgres.
I tried this:
select
row_number() over (ORDER BY cgcode_odc_mapping_id)as rownum,
cgcode_odc_mapping_id
from access_odc.access_odc_mapping_tb
order by cgcode_odc_mapping_id
and got this error:
ERROR: syntax error at or near "over" LINE 1: select row_number() over (ORDER BY cgcode_odc_mapping_id)as
I have checked these pages : How to show row numbers in PostgreSQL query?
This is my query:
select row_number() over (ORDER BY cgcode_odc_mapping_id)as rownum,cgcode_odc_mapping_id from access_odc.access_odc_mapping_tb order by cgcode_odc_mapping_id
this is the error:
ERROR: syntax error at or near "over" LINE 1: select row_number() over (ORDER BY cgcode_odc_mapping_id)as
Not Working
doesn't tell us anything that we can help with. Please could you give error messages and/or any other relevant information. Also, please specify the version of PostgreSQL that you are using. – MatBailieselect version()
- there is no (and never was) a version 1.8 – a_horse_with_no_name