sql中as用法
来源:互联网 发布:淘宝运营做什么的 编辑:程序博客网 时间:2024/05/19 04:04
<strong><span style="color: rgb(51, 51, 51);">as 可理解为:用作、当成,作为;</span><span style="color: rgb(255, 0, 0);">一般是重命名列名或者表名</span><span style="color: rgb(51, 51, 51);">。</span></strong><span style="color: rgb(51, 51, 51);">1.例如有表table, 列 column_1,column_2 你可以写成 select column_1 as 列1,column_2 as 列2 from table as 表上面的语句就可以解释为,选择 column_1 作为 列1,column_2 作为 列2 从 table 当成 表</span>
<span style="color: rgb(51, 51, 51);"></span>
2.<pre id="answer-content-800959615" class="answer-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);">SELECT * FROM Employee AS emp这句意思是查找所有Employee 表里面的数据,并把Employee表格命名为 emp。当你命名一个表之后,你可以在下面用 emp 代替 Employee.例如 SELECT * FROM emp.
</pre><pre id="answer-content-800959615" class="answer-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);">3.<pre id="answer-content-800972086" class="answer-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; background-color: rgb(255, 255, 255);">把查询对像起个别名的作用。select ID as 用户ID,Name as 用户名 from Table_user查出结果就以中文显示select * from tb_user as mytableA join select * from Tb_UserGroup as mytableBon mytableA.ID=mytableB.ID。这样就可以把查询结果起别名
0 0
- sql中AS用法
- sql中as用法
- SQL中as的用法
- SQL 中 with as 用法(转)
- SQL 中With as 的用法
- SQL 中With as 的用法
- SQL 中With as 的用法
- SQL 中 with as 用法(转)
- SQL 中With as 的用法
- SQL 中With as 的用法
- SQL 中With as 的用法
- sql中with as的用法
- SQL语句中as的用法
- sql 中 with as 用法
- sql语句中as的用法
- SQL server 中as的用法总结
- sql中With AS语句的用法
- sql语句中as的用法
- Eclipse快捷键大全
- Java中断机制
- Android手机6.0系统查询本地视频音频数据库查不出来数据的办法
- 对数组每个数进行操作的系统方法
- Android 使用Ant打包
- sql中as用法
- 使用POI导入数据到Excel数据量过大报错解决方案
- LeetCode|Intersection of Two Linked Lists
- 解决C#程序只允许运行一个实例的几种方法详解
- PHPCMS首页调用TAG关键字列表
- Android不透明度16进制值
- IOS开发UI篇--仿射变换(CGAffineTransform)使用小结
- 虚拟机中VMware tools工具的安装
- Javascript异步编程的4种方法(阮一峰)