-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCross Join in SQL.txt
More file actions
30 lines (29 loc) · 918 Bytes
/
Cross Join in SQL.txt
File metadata and controls
30 lines (29 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Cross JOIN/Cartesian Join/ Cartesian Product/Cross Product
-> The cross join returns every row from one table crossed with every row from the second.
syntax: SELECT * FROM emp CROSS JOIN student;
:SELECT name,sname FROM emp CROSS JOIN student;
ex:select name, dob from student_reg, new;
+---------+------------+
| name | dob |
+---------+------------+
| RAM | 1998-12-15 |
| RAM | 1998-12-15 |
| RAM | 1998-12-15 |
| RAM | 1998-12-15 |
| SITA | 2001-10-11 |
| SITA | 2001-10-11 |
| SITA | 2001-10-11 |
| SITA | 2001-10-11 |
| HARI | 2001-01-12 |
| HARI | 2001-01-12 |
| HARI | 2001-01-12 |
| HARI | 2001-01-12 |
| BIMAl | NULL |
| BIMAl | NULL |
| BIMAl | NULL |
| BIMAl | NULL |
| SITA KC | 1998-02-02 |
| SITA KC | 1998-02-02 |
| SITA KC | 1998-02-02 |
| SITA KC | 1998-02-02 |
+---------+------------+