pegeraw
pegeraw

Reputation: 11

Sybase - join doesn't work properly

I've got a problem. I'm using sybase at my school, and when I'm making my project I see a few problems. I learnt that join without on clause should work like cross join (cartesian product). But when I'm doing join between two tables, A and B for example.

Select * from A join B 

works exactly the same as A join B on A.Key=B.key. I have to use cross join to have cartesian.

And I have another question: I should be able to join tables without any relations and get cartesian product of them but instead I see "there is no way to join table X to Y".

Upvotes: 1

Views: 461

Answers (1)

James K. Lowden
James K. Lowden

Reputation: 7837

Apparently on the Sybase system you're using, join without on means a "natural join": one that implies a join based on columns of the same name (or, maybe, following foreign key declarations).

I learnt that join without on clause should work like cross join

In the early days, SQL had no join keyword. Your query would have been expressed as Select * from A, B. That produced a cartesian product. From a relational perspective, that product was winnowed with a relational select (restrict) operator, using where.

Upvotes: 1

Related Questions