List:General Discussion« Previous MessageNext Message »
From:R. Hannes Niedner Date:November 13 2002 5:30am
Subject:Re: support table synonyms?
View as plain text  
On 11/12/02 8:59 PM, "Phillip Rhodes" <rhodespc@stripped> wrote:

> I can not find anywhere that says that mysql supports table name synonyms.
> 
> For example, I have two databases (test1 and test2) in the same mysql
> instance.
> 
> In test1 schema, there is a table called "table1"
> 
> I would like to create a synonym whereby I could refer to test1.table1 as
> test2.table1 where test2.table1 does not exist.

This sounds like a CREATE VIEW statement ... And is not the same as a
synonym, If I am not wrong views will be introduced not before version 5 :-(
> 
> I could do this in oracle as ..
> create public synonym table1 as test1.table1;

But you can have synonyms, they are just not persistent and exit only within
the query:

SELECT t1.fieldX, t2.fieldY
FROM table1 t1, table2 t2
WHERE t1.fieldY = t2.fieldX

t1, t2 are synonyms for table1 and table2 respectively.
> 
HTH/h

Thread
support table synonyms?Phillip Rhodes13 Nov
  • Re: support table synonyms?R. Hannes Niedner13 Nov
  • Re: support table synonyms?Dan Nelson13 Nov
  • Re: support table synonyms?Peter Brawley13 Nov