If in the SELECT query we use the RowNum pseudo- RowNum function without an alias and immediately write -- какой-то комментарий after it, then the result will be a column under the implicitly generated alias = ("RowNum--" + comment text), removing the spaces and bringing the characters to the top register.
Example illustration:

 SELECT * FROM( SELECT DUMMY, ROWNUM --12 some 34 thing FROM DUAL ) TestTable WHERE TestTable."ROWNUM" > 0 --ОШИБКА 

working variant of accessing the column by pseudonym:

 --WHERE TestTable."ROWNUM--12some34thing" > 0 --всё ещё ОШИБКА WHERE TestTable."ROWNUM--12SOME34THING" > 0 --корректно только в верхнем регистре! 

Similarly, for /*...*/ multi-line comment.
This is not a problem (at least mine), it’s just interesting :) but it may cost someone nerves, for some reason it’s not google.

    1 answer 1

    I could not find an explanation for all of this in one place. However, in parts most are googled.

    1. ROWNUM - pseudo ROWNUM . The effect you notice applies to any expression. The column itself has a name, and the expression does not, therefore the name for the expression is generated if it is not specified explicitly. For example:

       select dummy, dummy x, 2*2, 2*2 /*duplicate*/, rownum, rownum -- preved from dual; DX 2*2 2*2/*DUPLICATE*/ ROWNUM ROWNUM--PREVED - - ---------- ---------------- ---------- -------------- XX 4 4 1 1 

      The rules for generating google so far failed. Naidu - add. If anyone knows - you can safely edit the answer.

    2. There is a Database Object Names and Qualifiers - there it is written about upper case:

      Nonquoted identifiers are not case sensitive. Oracle interprets them as uppercase. Quoted identifiers are case sensitive.

    • It is logical, of course - but for some reason I expected the comments to be ignored; about the fact that if such a single-line comment in the SELECT field ends with a dash, then it implicitly completely hides the next query line when processing it makes sense to write what you think? :) - Alias
    • So this is just the usual behavior for comments, as elsewhere. Well, or I do not understand what you mean. - Dmitriy
    • As a result, the fix comes down to ROWNUM --12 some 34 thing with the ROWNUM AS ROWNUM --12 some 34 thing - Herman Borisov