July 10, 2014 at 5:22 pm
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
July 10, 2014 at 5:57 pm
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?
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
July 10, 2014 at 6:39 pm
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.
July 11, 2014 at 2:22 am
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
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply