Join Clause Using

  • I have been writing SQL code for over 20 years and came across something new recently; a join being done with a Using Clause. I had never heard of this before so I started doing some research. What I found is that it appears to be part of the ANSI SQL: 2003 Standard and is documented in My SQL. But, the join does not work in SQL Server (I tried it on SQL 2008). I'm just curious, was this ever valid syntax in SQL Server? Has it become obsolete? For those not familiar, the query would be something like:

    select a.col1, b.col2

    from a inner join b using (col3)

    compared to

    select a.col1, b.col2

    from a inner join b on a.col3 = b.col3

  • It's not been part of T-SQL.

    Some flavors of SQL have different ways of handling implicit or default joins, or similar things, like this. Microsoft hasn't implemented this particular one.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thanks. I was pretty sure that I had never seen this in SQL Server.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply