开发者社区 问答 正文

What is an Alias in SQL?

已解决

What is an Alias in SQL?

展开
收起
1780169608831412 2021-10-16 15:01:34 651 分享 版权
1 条回答
写回答
取消 提交回答
  • 网络规划设计师、敏捷专家、CISP、ITSS服务经理、ACA全科目、ACP4项、ACE、CBP、CDSP、CZTP等。拥有 PRINCE2 Foundation/Practitioner、CCSK、ITIL、ISO27001、PMP等多项国际认证。 专利5+、期刊10+、知识产权师。核心期刊审稿人。
    采纳回答

    An alias is a feature of SQL that is supported by most, if not all, RDBMSs. It is a temporary name assigned to the table or table column for the purpose of a particular SQL query. In addition, aliasing can be employed as an obfuscation technique to secure the real names of database fields. A table alias is also called a correlation name.

    An alias is represented explicitly by the AS keyword but in some cases, the same can be performed without it as well. Nevertheless, using the AS keyword is always a good practice.

    SELECT A.emp_name AS "Employee"  /* Alias using AS keyword */
    B.emp_name AS "Supervisor"
    FROM employee A, employee B   /* Alias without AS keyword */
    WHERE A.emp_sup = B.emp_id;
    
    2021-10-16 16:19:44
    赞同 1 展开评论
问答分类:
SQL
问答标签:
问答地址: