如何在Oracle中为表命名? [英] How can I give an alias to a table in Oracle?

查看:96
本文介绍了如何在Oracle中为表命名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不能为Oracle DB中的表赋予别名?我试图写这样的声明:

Why can't I give an alias to a table in Oracle DB? I tried to write a statement like this one:

select count(id) from users as usr where usr.dept = "SVC";

但是Oracle向我抛出了一个错误.我不记得在MySQL中使用类似内容时遇到问题.

But Oracle threw me an error. I don't remember having problem when I use something like this in MySQL.

如何在Oracle中为表命名?

How can I give an alias to a table in Oracle?

推荐答案

Oracle不允许as作为表别名,而仅允许使用列别名.也是这样:

Oracle doesn't allow as for table aliases, only column aliases. So do:

select count(id)
from users usr
where usr.dept = 'SVC';

这篇关于如何在Oracle中为表命名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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