Should I Always Fully Qualify Column Names In SQL?

后端 未结 11 1137
小鲜肉
小鲜肉 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:19

    I would put this as personal preference. It would only make a difference if you started joining tables which contain duplicate column names.

    Also, rather than write out the table name in full, use an alias:

    SELECT t.column1, t.column2 FROM table as t

提交回复
热议问题