SQL Right dołącz
SELECT Customers.customer_id, Customers.first_name, Orders.amount
FROM Customers
RIGHT JOIN Orders
ON Customers.customer_id = Orders.customer;
SAMER SAEID
SELECT Customers.customer_id, Customers.first_name, Orders.amount
FROM Customers
RIGHT JOIN Orders
ON Customers.customer_id = Orders.customer;
SELECT Customers.customer_id, Customers.first_name, Orders.amount
FROM Customers
INNER JOIN Orders
ON Customers.customer_id = Orders.customer
WHERE Orders.amount >= 500;
RIGHT JOIN: Matching part from both
table and unmatching part from right table.
SELECT Customers.customer_id, Customers.first_name, Orders.amount
FROM Customers
RIGHT JOIN Orders
ON Customers.customer_id = Orders.customer;
SELECT columns
FROM table1
LEFT JOIN table2
ON table1.column_name = table2.column_name;
SELECT columns
FROM table1
RIGHT JOIN table2
ON table1.column_name = table2.column_name;