在选择所有列和更多列时缺少表达式

时间:2022-10-07 22:29:50

This kind of query would work perfectly in SQL Server, but it does not work in Oracle.

这种查询在SQL Server中可以很好地工作,但是在Oracle中不能工作。

select issueno, * from SOMETABLE;

The error message I'm getting is:

我得到的错误信息是:

ORA-00936: missing expression 00936. 00000 - "missing expression" *Cause:
*Action: Error at Line: 1 Column: 16

ora - 00936:00936年失踪的表达式。00000 -“缺少表达式”*原因:*动作:行:1列:16

What is wrong?

是什么错了吗?

2 个解决方案

#1


6  

Try this, when working with oracle db you need alias when you use column name along with *

尝试一下,当使用oracle db时,当您使用*和列名时,您需要别名

select issueno, A.* from SOMETABLE A;

#2


0  

On Oracle you have to include the table name or an alias to use the *. Try this:

在Oracle中,必须包含表名或别名才能使用*。试试这个:

select issueno, SOMETABLE.*
from SOMETABLE;

#1


6  

Try this, when working with oracle db you need alias when you use column name along with *

尝试一下,当使用oracle db时,当您使用*和列名时,您需要别名

select issueno, A.* from SOMETABLE A;

#2


0  

On Oracle you have to include the table name or an alias to use the *. Try this:

在Oracle中,必须包含表名或别名才能使用*。试试这个:

select issueno, SOMETABLE.*
from SOMETABLE;