T-SQL syntax shortening when JOIN columns have the same name in both tables?

In T-SQL, is it possible to simplify the specification JOIN( ON โ€ฆ) for equidistant between two tables when such a join occurs in two columns having the same name in both tables?

CREATE TABLE T1 (X โ€ฆ PRIMARY KEY);
CREATE TABLE T2 (X โ€ฆ REFERENCES T1 (X));

Normally I would write such an (internal) join as follows:

SELECT โ€ฆ FROM T1 JOIN T2 ON T1.X = T2.X;

What I would like is something simpler, for example:

SELECT โ€ฆ FROM T1 JOIN T2 ON X;

Is such an abbreviation of the specification ON โ€ฆpossible? (I expect the answer to be no, but I would like to make sure.)

If not, are there any special reasons why not? (For example, is it possible that this will lead to frequent ambiguity of columns when joining more than two tables and, consequently, little practical use?)

+4
2

SQL ANSI 92

SELECT โ€ฆ FROM T1 NATURAL JOIN T2

SQL Server. , , , , .

,

    FROM T1 JOIN T2 ON X;
+7
  • SQL Server (T-SQL) . JOIN.
  • Oracle (P-SQL) NATURAL JOIN .
  • MySQL USING SQL Server Oracle . A JOIN B USING (col1, col2, col3)

NATURAL JOIN ANSI SQL, , , SQL . .

+2

All Articles