我都第一个数据库(DBA)有这样的表,命名为用户名:如何在2个不同的数据库上左连接2个表?
+------------------+--------------+
| Username | PhoneNumber |
+------------------+--------------+
| jamesbond007 | 555-0074 |
| batmanbegins | 555-0392 |
+------------------+--------------+
然后,在另一边,我有DBB与表这样的,命名为PrivateMessage:
+------------------+---------------------------------+
| Username | Message |
+------------------+---------------------------------+
| jamesbond007 | I need new bond-girl |
| batmanbegins | thanks for the paycheck, Nolan |
+------------------+---------------------------------+
现在,如何这两个表从2个不同的数据库结合,从而输出将是这样的:
+------------------+--------------+---------------------------------+
| Username | PhoneNumber | Message |
+------------------+--------------+---------------------------------+
| jamesbond007 | 555-0074 | I need new bond-girl |
| batmanbegins | 555-0392 | thanks for the paycheck, Nolan |
+------------------+--------------+---------------------------------+
既然你有不同的排序规则,见我的回答如下。 –
dbA,dbB是一个表而不是数据库。 – fearis