On 11/12/02 8:59 PM, "Phillip Rhodes" <[EMAIL PROTECTED]> 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


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to