In SQL, what is the letter after a table name in a select statement?

后端 未结 9 1116
时光取名叫无心
时光取名叫无心 2020-12-19 11:28

In

SELECT a.NAME, a.NUMBER, a.STRING, a.RDB$DB_KEY FROM ADMIN a

what does a stand for?

Thanks.

9条回答
  •  长情又很酷
    2020-12-19 11:30

    A is an alias for the table.

    You can change a to any valid identifier, it isn't dependant on the underlying schema. Usually it's used to differentiate fields from different tables, saves you typeing the full table name each time (makes the SQL easier to read with a short alias).

    It isn't actually required in the sample you gave,

    SELECT NAME, NUMBER, STRING, RDB$DB_KEY FROM AMDIN
    

    should work just as well

提交回复
热议问题