Join using clause : Table Join Column « Table Joins « Oracle PL / SQL

Home
Oracle PL / SQL
1.Aggregate Functions
2.Analytical Functions
3.Char Functions
4.Constraints
5.Conversion Functions
6.Cursor
7.Data Type
8.Date Timezone
9.Hierarchical Query
10.Index
11.Insert Delete Update
12.Large Objects
13.Numeric Math Functions
14.Object Oriented Database
15.PL SQL
16.Regular Expressions
17.Report Column Page
18.Result Set
19.Select Query
20.Sequence
21.SQL Plus
22.Stored Procedure Function
23.Subquery
24.System Packages
25.System Tables Views
26.Table
27.Table Joins
28.Trigger
29.User Previliege
30.View
31.XML
Oracle PL / SQL » Table Joins » Table Join Column 
Join using clause
  

SQL> CREATE TABLE emp(
  2     cid                NUMBER,
  3     postal_code           VARCHAR2(10),
  4     city              VARCHAR2(30),
  5     customer_state             VARCHAR2(40),
  6     country_id                 CHAR(2),
  7     customer_credit            NUMBER,
  8     email                 VARCHAR2(30)
  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> select cid, c.customer_state,s.sold
  2  from sales s join emp c
  3  using (cid)
  4  where product_id = 117;

no rows selected

SQL>
SQL> drop table sales;

Table dropped.

SQL> drop table emp;

Table dropped.

   
    
  
Related examples in the same category
1.Join two tables: column is not mentioned in the SELECT list
2.Join with (+)
3.Use in operator with table join
4.Use column name alias during table join
5.3-Way join
6.Join and GROUP BY
7.Join three table to find out which employee sold that gift
8.Join using and join on
9.Join columns with full table name reference
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.