Right join with where in clause : Outer Joins Left Right « Table Joins « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE TABLE emp
  2  (
  3     cid                NUMBER,
  4     lname         VARCHAR2(40) ,
  5     city              VARCHAR2(30) ,
  6     customer_state             VARCHAR2(40),
  7     country_id                 CHAR(2) ,
  8     customer_credit            NUMBER
  9  );

Table created.

SQL>
SQL> CREATE TABLE sales(
  2    product_id                NUMBER(6),
  3    cid               NUMBER,
  4    time_id                   DATE,
  5    channel_id                CHAR(1),
  6    promo_id                  NUMBER(6),
  7    sold             NUMBER(3),
  8    amount                    NUMBER(10,2),
  9    cost                      NUMBER(10,2)
 10  );

Table created.

SQL>
SQL>
SQL>
SQL> select c.cid, c.lname, s.product_id, s.sold
  2  from sales s right join emp c
  3     on c.cid = s.cid
  4  where c.cid in (1,80);

no rows selected

SQL>
SQL> drop table sales;

Table dropped.

SQL> drop table emp;

Table dropped.

SQL>
SQL>








7.4.Outer Joins Left Right
7.4.1.Understanding Outer Joins
7.4.2.Left and Right Outer Joins
7.4.3.An Example of a Left Outer Join 1
7.4.4.An Example of a Left Outer Join 2
7.4.5.An Example of a Right Outer Join 1
7.4.6.An Example of a Right Outer Join 2
7.4.7.Perform outer joins in combination with self joins, employee and job tables
7.4.8.Example outer join with (+)
7.4.9.Right outer join with using statement
7.4.10.Right outer join with group by
7.4.11.LEFT OUTER JOIN tableName ON joined columns
7.4.12.LEFT OUTER JOIN vs RIGHT OUTER JOIN
7.4.13.Left Outer Join
7.4.14.Right Outer Join
7.4.15.Right Outer Join(room vs class)
7.4.16.Right join with where in clause