0

I am aware we can use ALIAS in FROM clause at SELECT but its giving error for me.
sample code:-

 select a.first_name from( select first_name from EMPLOYEES where first_name='Ellen') as a;

my code:-

 SELECT a.id_employee FROM(SELECT id_employee FROM table1 union  SELECT id_employee FROM table2) as a;

I get the error 00933. 00000 - "SQL command not properly ended"

sql_dummy
  • 715
  • 8
  • 23
  • Possible duplicate of [oracle: can you assign an alias to the from clause?](http://stackoverflow.com/questions/4940530/oracle-can-you-assign-an-alias-to-the-from-clause) – Jon Heller Mar 12 '16 at 06:52
  • @JonHeller In the case you mentioned ALIAS is working fine for him. But in my case I am getting an error – sql_dummy Mar 12 '16 at 07:50
  • Remove the `as` and it will work. Oracle doesn't like that in `FROM` clause. – tvm Mar 12 '16 at 08:09
  • @tvm yes it worked well without `AS` .Thanks.But why is it asked to use `AS` in the case http://stackoverflow.com/questions/4940530/oracle-can-you-assign-an-alias-to-the-from-clause – sql_dummy Mar 12 '16 at 08:16
  • @sql_dummy `AS` can be used for column aliases but not for table aliases. – Jon Heller Mar 13 '16 at 02:41

0 Answers0