Reputation: 4933
I found a sproc in a db that I think infers a table join?
Is that accurate to deduce that from the sample below?
SELECT a.Column1, b.Column2
FROM [dbo].[Table1] As a,
[dbo].[Table2] AS b
Upvotes: 0
Views: 69
Reputation: 3572
It does infers a join, but that join is a CROSS JOIN
, which is rarely what you want. It won't simply map each row of a
to its equivalent in b
. Instead, it will map each row of a
to every row of b
. That is a join, but it's not what we often think of when we talk about joins.
I wanted to show a quick example, but unfortunately SQL Fiddle is down. Sorry!
More on cross joins and cartesian products in SQL Server here.
Upvotes: 3
Reputation: 35318
Yes, it's called a "Natural Join". You can constrain it with the WHERE
clause.
Upvotes: 2