Home > database >  [small white help] add a field in a SQL statement table can lead to the result difference.
[small white help] add a field in a SQL statement table can lead to the result difference.

Time:11-20

When they study data group came up with an idea, is the time when the query a field no more related tables results will be the same?

First is the teaching material to the output of the result is like this:

In the from clause, I added a table, the following is the output:

Finally is the content of the products with the orderitems two table




Excuse me, ladies and gentlemen, what causes two output difference so big?


CodePudding user response:

At first sight is only added a table without any conditions involving or take field

But in fact this syntax is to put the two tables directly associated unconditionally is equivalent to B2, table 1 * data volume will increase geometric

Then aggregate value is increased, and let originally filter & gt;=50, should not appear figures out

Not surprisingly, according to the result of your check, I can even know that there are 14 products table data

CodePudding user response:

reference 1/f, three years 丿 response:
at first sight is just a list, without any conditions involving or take field

But in fact this syntax is to put the two tables directly associated unconditionally is equivalent to B2, table 1 * data volume will increase geometric

Then aggregate value is increased, and let originally filter & gt;=50, should not appear figures out

Not surprisingly, according to the result of your check, I can even know that there are 14 products table data

Is the same as the cartesian product of principle ah
  • Related