PRB: Zero Rows Returned from SQL SELECT Statement

ID Number: Q59461

1.00 1.10 1.11 4.20

OS/2

Summary:

SYMPTOMS

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

select t1.* from t1,t2

"t1" has key values of 1, 2, 3, and 4; "t2" 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 reference words: 1.00 1.10 4.20 1.11 1.Transact-SQL