Short Join Syntax?

  • I swear I remember reading somewhere about an alternate, shorter JOIN syntax in cases where the column being joined has the same name in both tables. But I can't seem to find a reference to it by Googling. Am I misremembering?

    It was something like this:

    SELECT T1.ColID

    FROM T1

    INNER JOIN T2 ON ColID


    "If I had been drinking out of that toilet, I might have been killed." -Ace Ventura

  • autoexcrement (7/10/2014)


    I swear I remember reading somewhere about an alternate, shorter JOIN syntax in cases where the column being joined has the same name in both tables. But I can't seem to find a reference to it by Googling. Am I misremembering?

    It was something like this:

    SELECT T1.ColID

    FROM T1

    INNER JOIN T2 ON ColID

    I've never seen that in T-SQL. MySQL maybe?


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • I think it was in one of my Louis Davidson books, it was almost definitely T-SQL. But I'll have to go try to dig it up.


    "If I had been drinking out of that toilet, I might have been killed." -Ace Ventura

  • T-SQL has no join constructs like that.

    Oracle (iirc) has a NATURAL JOIN which joins on the foreign key columns, but SQL Server doesn't have that

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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