Natural Joins - Still not in MS SQL Server

来源:互联网 发布:淘宝上买的q币可以退吗 编辑:程序博客网 时间:2024/04/30 05:35
One of the coolest join options in Oracle is the Natural Join. Provided that the tables' columns were named such that the column name indicated which columns in two or more tables should be used for a join, it reduced the effort in writing SQL queries.

Instead of writing a:
SELECT ContactName, CityName
FROM Contact
JOIN City ON Contact.CityId = City.CityId
you could simply write:
SELECT ContactName, CityName
FROM Contact
NATURAL JOIN City

Considering how Microsoft has been trying to make development easier for software programmers, this is one feature that they ought to think about.
原创粉丝点击