sql - ROWNUM returns as "invalid identifier" -


i running basic select against oracle database (not sure of version).

select * accounting id = 123456 order date 

i want return recent record. have tried ...

select rownum, * accounting id = 123456 order date select * accounting id = 123456 , rownum < 2 order date 

i same result every time ...

error source: system.data.oracleclient     error message: ora-00904: "rownum" : invalid identifier 

everything see , read suggests should work. can see missing? issue driver? using following package ... (oracle odac 11.20.30 x64)

update

thank replies ... apologize confusion created in efforts simplify scenario. odac driver breaking query out , formatting me, posted not exactly query being run ... here's, driver spitting out generating error ...

select "rownum", id, site_id, reading_date, submitted_date, deposit_date    accounting   (site_id = 33730) order reading_date 

and second attempt ...

select id, site_id, reading_date, submitted_date, deposit_date    accounting   (site_id = 33730) , ("rownum" < 2) order reading_date 

your actual query might using rownum within double quotes. otherwise, error not possible.

though first query ora-00936: missing expression

select * dual "rownum" < =3;  error report - sql error: ora-00904: "rownum": invalid identifier 00904. 00000 -  "%s: invalid identifier" *cause:     *action: 

rownum pseudo-column , function without parameters.. , way "rownum" makes oracle search such column in table..

quoted identifiers when oracle reserved keyword, surpass original purpose, , behaves user defined column.

unsure, of how stop query builder interpret way. consider bug.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -