当我尝试在 FROM 之后重命名表时,为什么会出现错误? [英] Why do I get an Error when I try to rename a table after FROM?

查看:69
本文介绍了当我尝试在 FROM 之后重命名表时,为什么会出现错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我只是尝试检索表中的所有行时 EMPLOYEE 像这样:

When I simply try to retrieve all of the rows in my table EMPLOYEE like this:

SELECT *
FROM EMPLOYEE AS emp;

我收到以下错误:

ORA-00933: SQL command not properly ended 
00933. 00000 -  "SQL command not properly ended"
*Cause:    
*Action: 
Error at Line: 14 Column: 11

如果我删除 AS emp 它工作得很好,但我想在这里重命名我的表.我是否遗漏了一些非常明显的东西?

If I remove the AS emp it works just perfectly fine, but I want to rename my table here. Am I missing something totally obvious?

推荐答案

我认为这是您的数据库引擎的问题.从我收集到的错误中,您正在使用 Oracle.表的 Oracle 别名是:table_name alias_name (https://www.techonthenet.com/oracle/alias.php)

I believe that is a problem with your database engine. From the error i gather you are using Oracle. Oracle alias for tables is: table_name alias_name (https://www.techonthenet.com/oracle/alias.php)

因此将查询更改为:

SELECT *
FROM EMPLOYEE emp;

这篇关于当我尝试在 FROM 之后重命名表时,为什么会出现错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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