C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
SQL RIGHT JOINThe SQL right join returns all the values from the rows of right table. It also includes the matched values from left table but if there is no matching in both tables, it returns NULL. Basic syntax for right join: SELECT table1.column1, table2.column2..... FROM table1 RIGHT JOIN table2 ON table1.column_field = table2.column_field; let us take an example with 2 tables table1 is CUSTOMERS table and table2 is ORDERS table. CUSTOMER TABLE:
and this is the second table: ORDER TABLE:
Here we will join these two tables with SQL RIGHT JOIN: SQL> SELECT ID,NAME,AMOUNT,DATE FROM CUSTOMER RIGHT JOIN ORDER ON CUSTOMER.ID = ORDER.CUSTOMER_ID;
Next TopicSQL Full Join
|