简体   繁体   English

如何在 SQL 中创建视图,为列名创建别名?

[英]how to create a view in SQL creating an alias for the column names ?

I not find a way to create a view so that you can change the column names of the original structure of the table for a more "friendly" alias.我找不到创建视图的方法,以便您可以更改表原始结构的列名以获得更“友好”的别名。

thanks谢谢

In most DBMS you can use the "AS" keyword in the SELECT statement:在大多数 DBMS 中,您可以在 SELECT 语句中使用“AS”关键字:

CREATE VIEW myView AS (
  SELECT 
    id AS friendly_id,
    value AS friendly_value
  FROM table
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM