Author Topic: Aliasing in Oracle  (Read 2010 times)

0 Members and 1 Guest are viewing this topic.

Offline mlnsharmaTopic starter

  • Irregular
  • Posts: 12
    • View Profile
Aliasing in Oracle
« on: August 28, 2009, 11:21:56 PM »
select * from table as t where t.sal>100 ;
                           *
ORA-00933: SQL command not properly ended


What is the error here?
In Oracle, this statement is showing an error, while it is fine in Mysql?
Can anyone answer this please?

« Last Edit: August 28, 2009, 11:26:44 PM by mlnsharma »

Offline mlnsharmaTopic starter

  • Irregular
  • Posts: 12
    • View Profile
Aliasing in Oracle
« Reply #1 on: August 29, 2009, 01:28:30 AM »
I got it..Removed the 'as' keyword and is working fine..

But

alter table emp drop column sal;  //query is not working.i tried it this way also

alter table emp drop sal;

It is working with Mysql, but with oracle, it is not dropping the column "sal".It says "Missing Keyword" for both queries(above).

Please suggest a solution.. :'(

Offline artacus

  • Devotee
  • Posts: 915
  • Gender: Male
  • World domination? Never heard of it.
    • View Profile
    • Flex and Specs()
Re: Aliasing in Oracle
« Reply #2 on: September 08, 2009, 03:25:58 PM »
Quote
alter table emp drop column sal;

That is the correct syntax. You may need to identify the schema, and you'll need to have permission to edit the table. But I can see no reason why this wouldn't work.
artacus

-- Trust your leaders, depend on your government, don't question the media... and this won't hurt a bit. --