官术网_书友最值得收藏!

  • MySQL 8 for Big Data
  • Shabbir Challawala Jaydip Lakhatariya Chintan Mehta Kandarp Patel
  • 74字
  • 2021-08-20 10:06:14

RIGHT JOIN

RIGHT JOIN fetches all records from the right and common records from the left table. If we use the customer and order table example with right join, it will fetch all records from the customer table even if there are no matches in the left table (order). To fetch all customer details with order, the following query can be used:

SELECT order.order_id, customer.name
FROM order
RIGHT JOIN customer ON order.customer_id = customer.customer_id;
主站蜘蛛池模板: 建湖县| 乡城县| 湘乡市| 南投县| 大田县| 丹江口市| 苏尼特右旗| 禹城市| 汉沽区| 耒阳市| 水城县| 芷江| 许昌县| 固原市| 沧州市| 东宁县| 游戏| 桐城市| 广德县| 宿州市| 竹北市| 积石山| 临夏市| 榆中县| 务川| 贞丰县| 广元市| 海南省| 齐河县| 常山县| 福海县| 丹巴县| 马龙县| 石首市| 宁海县| 四平市| 宁陕县| 修武县| 垣曲县| 嘉祥县| 林西县|