<strong><span style="color:#333333;">as 可理解为:用作、当成,作为;</span><span style="color:#ff0000;">一般是重命名列名或者表名</span><span style="color:#333333;">。</span><span style="color:#333333;"> 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></strong>
<strong><span style="color:#333333;"> </span></strong>
<strong>2.</strong><pre name="code" id="answer-content-800959615" class="answer-text mb-10" style="margin-top:0px; margin-bottom:10px; padding:0px; font-family:arial,'courier new',courier,宋体,monospace; white-space:pre-wrap; word-wrap:break-word; color:rgb(51,51,51); font-size:14px; line-height:24px; background-color:rgb(255,255,255)"><strong>SELECT * FROM Employee AS emp 这句意思是查找所有Employee 表里面的数据,并把Employee表格命名为 emp。 当你命名一个表之后,你可以在下面用 emp 代替 Employee. 例如 SELECT * FROM emp.</strong>
<strong>3.</strong><pre name="code" id="answer-content-800972086" class="answer-text mb-10" style="margin-top:0px; margin-bottom:10px; padding:0px; font-family:arial,'courier new',courier,宋体,monospace; white-space:pre-wrap; word-wrap:break-word; color:rgb(51,51,51); font-size:14px; line-height:24px; background-color:rgb(255,255,255)"><strong>把查询对像起个别名的作用。 select ID as 用户ID,Name as 用户名 from Table_user 查出结果就以中文显示 select * from tb_user as mytableA join select * from Tb_UserGroup as mytableB on mytableA.ID=mytableB.ID。这样就可以把查询结果起别名 源自:http://blog.csdn.net/foreverhuylee/article/details/27985921 </strong>