PRB: Using a Self-Join to Produce a Cartesian ProductID: Q45493
|
In attempting to produce the Cartesian product of a table with itself, a self-join without a WHERE clause produces only the table itself.
A self-join without a WHERE clause does not produce a Cartesian
product unless the two instances of the table are given aliases and
the select list includes columns from both aliases. The following
does not produce a Cartesian product:
select * from t1,t1
The following does produce a Cartesian product:
select x.c1,y.c1 from t1 x, t2 y
Additional query words: Transact-SQL Windows NT
Keywords : kbprg SSrvProg SSrvServer SSrvWinNT
Version : 4.2 | 4.2
Platform : OS/2 WINDOWS
Issue type :
Last Reviewed: March 6, 1999