Reputation: 3
so I made a database which contains 2 tables, table1 and table2. if I use SELECT*FROM table 1 I get somthing like:
name1,adres1,city1
name2,adress2,city2
and if i use SELECT*FROM table 2 I get somthing like:
name1,gender1,hobies1
name2,gender2,hobbies2
but when i use SELECT*FROM table1,table2 I get:
name1,adres1,city1,name1,gender1,hobies1
name1,adress1,city1,name2,gender2,hobbies2
name2,adres2,city2,name2,gender2,hobies2
name2,adress1,city2,name1,gender1,hobbies1
why is this happening?
Upvotes: 0
Views: 23
Reputation: 1145
What you're experiencing is simply the result of Cartesian Product. You are selecting every possible combination of the rows in those two tables.
Upvotes: 0