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

痴心易碎 提交于 2019-12-17 17:12:15

问题


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";

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

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


回答1:


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

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


来源:https://stackoverflow.com/questions/22161802/how-can-i-give-an-alias-to-a-table-in-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!