View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default MS Query Oracle syntax

If I understand correctly, you want to obtain data from the Oracle database
in a column with some name, but you want it returned as another name? That
is an "alias" in Oracle SQL. I think your first example is pretty much what
you want, but you do not want to enclose the alias name within double quote
marks although I've seen examples showing it that way (bad examples).

Select f1 MyField From MyTable WHERE f1 = 1;
will work, I believe. To be honest, last time I worked with Oracle was back
with 8 was top of the pile, they're up to what? 10? 12? now. A search for
Oracle Alias should help more.

"Jeff" wrote:

Does anyone know syntax for renaming a field using MS Query with a
oracle databse?

select f1 "MyField" from mytable; returns an error


actually more correctly stated my query is something like
select myfunction(f1, f2, f3) "MyName" from table1 where f1 = 1;


Thanks for pointing me in the right direction.