Should I Always Fully Qualify Column Names In SQL?

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

    It's better if you do - it doesn't add any complexity, and it can prevent errors in the future.

    But in a well-defined system, you shouldn't have to - it's like namespaces in programming languages. The ideal is not to have conflicts, but it can clutter the code with the superfluous use of explicit names.

    -Adam

提交回复
热议问题