sql 指定字段名创建视图
时间: 2023-09-08 20:09:13 浏览: 337
在创建SQL视图时,可以指定字段名。下面是一个示例的SQL语句:
CREATE VIEW view_name AS
SELECT column1 AS new_column1, column2 AS new_column2
FROM table_name;
在这个例子中,我们使用CREATE VIEW语句来创建一个名为view_name的视图。SELECT语句用于选择要显示在视图中的列,并使用AS关键字为每个列指定新的字段名。你可以根据自己的需求修改列的名称和表的名称。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [SQL Server 数据库创建视图时修改字段长度](https://blog.csdn.net/weixin_42403922/article/details/113223947)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [sqlserver数据库创建视图时如何改变字段类型以及查询视图详细内容](https://blog.csdn.net/wzhwangzhuohui/article/details/79624073)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文