在Oracle中,"AS"别名不起作用 [英] In Oracle "AS" alias not working

查看:557
本文介绍了在Oracle中,"AS"别名不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只想知道为什么Oracle在查询中不允许使用"AS"别名. 在我的项目"中,我返回的所有查询都具有别名关键字"AS".

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.id,t2.name from Table1 As t1 ,Table2 t2 
on
  t1.id =t2.id

以上Query在所有服务器(如PostgreSQL,Microsoft SQL Server)中运行,但在Oracle中运行不正常 由于别名为"As",显示错误命令不存在". 如果我删除,它将运行.

above Query run in all Server like PostgreSQL ,Microsoft SQL server but in Oracle its Not working showing error "Command does not exists" because of alias "As". If i remove then it will run.

只想知道为什么Oracle Server会这样?我想使用"AS"别名来运行查询.

just want to know why Oracle Server behave like this ? i want to run query using "AS"alias name.

推荐答案

虽然Oracle允许您在定义列别名时使用AS,但不允许您在定义表别名时使用AS.这就是Oracle的工作方式.

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.

这篇关于在Oracle中,"AS"别名不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆