Microsoft KB Archive/59461

= PRB: Zero Rows Returned from SQL SELECT Statement =

Article ID: 59461

Article Last Modified on 2/14/2005

-

APPLIES TO


 * Microsoft SQL Server 4.21a Standard Edition
 * Microsoft SQL Server 6.0 Standard Edition
 * Microsoft SQL Server 6.5 Standard Edition
 * Microsoft SQL Server 7.0 Standard Edition

-



This article was previously published under Q59461



SYMPTOMS
Executing the following SQL statement returns 0 (zero) rows:

select t1.* from t1,t2

&quot;t1&quot; has key values of 1, 2, 3, and 4; &quot;t2&quot; is empty.



CAUSE
The above statement does not return any rows because when you specify two tables in the same SELECT statement without a WHERE qualifier, the result is a Cartesian product. However, a Cartesian product with one table empty is 0 rows. This is the same as multiplying any number by 0: the result is 0.

Additional query words: Transact-SQL Windows NT

Keywords: kbother KB59461

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.