如果我有一张如下表:
+------+-------+
| sno | cno |
+------+-------+
| 1 | CS112 |
| 1 | CS113 |
| 1 | CS114 |
| 2 | CS112 |
| 3 | CS112 |
| 3 | CS114 |
| 4 | CS112 |
| 4 | CS113 |
| 5 | CS113 |
| 6 | CS113 |
| 6 | CS114 |
+------+-------+
如果我进行内部自联接,sno
我希望看到以下顺序的行:
+------+-------+------+-------+
| sno | cno | sno | cno |
+------+-------+------+-------+
| 1 | CS112 | 1 | CS112 |
| 1 | CS112 | 1 | CS113 |
| 1 | CS112 | 1 | CS114 |
| 1 | CS113 | 1 | CS112 |
| 1 | CS113 | 1 | CS113 |
| 1 | CS113 | 1 | CS114 |
etc
+------+-------+------+-------+
但是顺序是
+------+-------+------+-------+
| sno | cno | sno | cno |
+------+-------+------+-------+
| 1 | CS112 | 1 | CS112 |
| 1 | CS113 | 1 | CS112 |
| 1 | CS114 | 1 | CS112 |
| 1 | CS112 | 1 | CS113 |
| 1 | CS113 | 1 | CS113 |
| 1 | CS114 | 1 | CS113 |
| 1 | CS112 | 1 | CS114 |
etc
+------+-------+------+-------+
即,我希望看到左侧的每一行对于骑行中的每一行都重复。反之亦然。即,它似乎获取所有行并将其与连接右侧的第一行匹配。
为什么是这样的顺序?