[kwlug-disc] [OT] how to create a mysql table alias in the db itself?

Terrence Enger tenger at iseries-guru.com
Tue Mar 9 14:47:24 EST 2010

On Tue, 2010-03-09 at 13:40 -0500, Robert P. J. Day wrote:
> i have a bunch of mysql queries from two different sources, and they
> purport to work on the same database but they access the same table by
> two different names.  can i add a simple alias to the database for
> just that one table?
>   i know i can add an alias to the queries themselves but there are
> hundreds of them and that would be painful.  i also see something
> called "views" which might work.  but is there a canonical way to
> simply add an alternative name for an existing table within the
> database itself so that all the existing queries don't need to be
> munged?  thanks.
> rday

I dunno about mySql, but in DB2 you can say something like ...

    create view newname as select * from existingtable


More information about the kwlug-disc mailing list