Should I Always Fully Qualify Column Names In SQL?

后端 未结 11 1157
小鲜肉
小鲜肉 2021-02-14 02:48

Out of interest when working with SQL statements should I always use the fully qualifed column name (tablename.columnname) even if only working with one table e.g.



        
11条回答
  •  抹茶落季
    2021-02-14 03:40

    No.

    You should always alias the tables, and you should always qualify your column names with the table aliases.

    select
        p.FirstName,
        p.LastName,
        p.SSN
    from Person p
    where p.ID = 345
    

提交回复
热议问题