3

Dumb question.. what logic does the database use to determine the result set if you do a select without a join such as:

select * from table1, table2
1
  • 3
    Just a semantic quibble: your select WILL join the tables. The "," operator is considered to be a synonym for CROSS JOIN (also known as cartesian join, as Ferreria has said). Jul 1, 2009 at 5:17

2 Answers 2

8

It uses a cartesian product, it gives every possible combination of the two tables.

More info on this, applied to SQL.

5

Cartesian product. Each row in table one is matched up to each row in table two.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.