In Oracle “AS” alias not working

前端 未结 3 1041
深忆病人
深忆病人 2021-01-26 12:48

Just want to know why Oracle not allowed \"AS\" alias in Query. In My project all queries which i returned have alias keyword \"AS\".

For.eg;

Select t1.i         


        
相关标签:
3条回答
  • 2021-01-26 13:16

    According to this and this this it should be part of the ISO SQL92. Maybe Oracle did not implement it because of backward compatibility.

    In Oracle keywords like "AS", "JOIN", "COMMIT", "MODEL" still can be used as object names. So you can write something like:

    select J.COMMIT AS
    from JOIN J;
    

    This will select column named "COMMIT" from table named "JOIN" and the column will be aliased to "AS".

    0 讨论(0)
  • 2021-01-26 13:28

    While Oracle allows you to use AS when defining column aliases, it doesn't allow you to use AS when defining table aliases. It's just how Oracle works.

    0 讨论(0)
  • 2021-01-26 13:39

    You can use as(optional) for alias in column names but not for table. Using as in aliases is Microsoft standard, while ORACLE supports ANSI SQL syntax which using as in aliases is not a standard.

    0 讨论(0)
提交回复
热议问题