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

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;
主站蜘蛛池模板: 大荔县| 丹棱县| 广汉市| 晋宁县| 金溪县| 临夏市| 大连市| 衢州市| 富顺县| 尼勒克县| 苍溪县| 观塘区| 中超| 柘荣县| 涟源市| 上高县| 宾川县| 仁布县| 酉阳| 正阳县| 海南省| 东莞市| 织金县| 日土县| 平山县| 昌图县| 汕尾市| 东乡族自治县| 岳阳市| 晴隆县| 柳河县| 德令哈市| 洛阳市| 景宁| 石棉县| 长海县| 河源市| 邯郸市| 绵阳市| 青海省| 北辰区|