Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: how do I select all column plus an alias via a query

Re: how do I select all column plus an alias via a query

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 02 Mar 2001 08:26:59 +0100
Message-ID: <7kiu9ts5553h52o32j6fq1rtqepb0u9vcf@4ax.com>

On Thu, 01 Mar 2001 21:37:54 GMT,
u545532226_at_spawnkill.ip-mobilphone.net wrote:

>I'm trying to get all of the fields of a table, plus a calculated
>column via a select query. Other databases (SQL Server, Access)
>can handle this functionality. If oracle can't, I will have to work
>around it. (A view on the server is not an option because the selects
>are dynamically created)
>
>An example of what I would want:
>SELECT *, SAL + COMM AS TOTAL FROM SCOTT.BONUS;
>
>The error message "ORA-00923: FROM keyword not found where expected"
>appears when this is run. (I'm running Oracle 8)
>
>Thanks in advance for any help.
>

Qualify the * with the table name or table alias like this select bonus.*, sal+comm as total
from bonus

I wouldn't say too fast 'Oracle can't', I would also try remember Oracle is a completely different beast (you shouldn't try to port your sql server habits to Oracle) and I would check the manual as often as possible.

Hth,

Sybrand Bakker, Oracle DBA Received on Fri Mar 02 2001 - 01:26:59 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US