Home >> MySql >> What is cross join in MySql

What is cross join in MySql

When two tables R1 and R2 every tuple of R1 gets combine every others tuple of R2.

R1(N1 tuple)*R2(N2 tuple)

N1*N2 number of tuple

Example

R1 table

A           B           C

X           10         100

Y           20         100

R2 table

C           D

100        L

200        M

Output

A       B       C        C        D

X       10     100      100     L

X       10     100      200    M

Y       20     100      100     L

Y       20     100      200     M

 

 

Post Your Comment

Next Questions
What is natural join
What is outer join
What is self join
What is aggregate function
COUNT(*) aggregate function
AVG() aggregate function
MIN() aggregate function
MAX() aggregate function
SUM() aggregate function
STDED() aggregate function
CONCAT() function
GROUP_CONCAT() function
CONCAT_WS() function
CHECKSUM_AGG() aggregate function
ABS(n) aggregate function
POWER(m,n) aggregate function
ROUND() aggregate function
SQRT() aggregate function
GREATEST() aggregate function
LEAST() aggregate function
EXP() aggregate function
EXTRACT() aggregate function
MOD() aggregate function
TRUNC() aggregate function
FLOOR() aggregate function

Copyright ©2022 coderraj.com. All Rights Reserved.