select as
时间: 2023-11-12 21:07:50 浏览: 110
在SQL查询语句中,使用AS关键字可以将字段或表重命名为指定的别名。例如,"SELECT column_1 AS 列1, column_2 AS 列2 FROM table AS 表"表示选择column_1作为列1,column_2作为列2,从table作为表进行查询。\[1\]
在另一个例子中,"SELECT * FROM Employee AS emp"表示查找所有Employee表中的数据,并将Employee表格命名为emp。之后可以使用emp代替Employee进行引用。\[1\]
此外,AS关键字还可以用于将字段名称转换为中文。例如,"SELECT id AS 序号, name AS 名称, cate_id AS 分类序号, brand_id AS 品牌序号, price AS 价格, is_show AS 是否上架, is_saleoff AS 是否售罄 FROM goods"将字段id重命名为序号,name重命名为名称,以此类推。\[2\]
#### 引用[.reference_title]
- *1* [sql语句中select……as的用法](https://blog.csdn.net/foreverhuylee/article/details/27985921)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [SQL语句中select...as...的特殊用法](https://blog.csdn.net/JasonPF/article/details/89646832)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文