如何在MySQL中为该表的表和列创建同义词?

Sha*_*lav 1 mysql sql synonym

我知道在oracle中我可以这样做:

create synonym Cutomers for LongTablePrefix_Customers
Run Code Online (Sandbox Code Playgroud)

现在,我可以编写像sql这样的语句

select * from Customers
Run Code Online (Sandbox Code Playgroud)

而不是滔天

select * from LongTablePrefix_Customers
Run Code Online (Sandbox Code Playgroud)

我意识到,mysql在那里具有相同的功能.我可以为表创建synonim,这是很好的,但是......但是字段名的样子LongTableName_ID,LongTableName_Name等是否有可能创造领域的同义词?

MrT*_*Tux 5

您可以创建一个视图

create view Customers show select LongTableName_ID as ID, LongTableName_Name as Name from LongTablePrefix_Customers
Run Code Online (Sandbox Code Playgroud)

MySQL中不可能使用同义词.