Natural Joins
A natural join enables you to display data from two tables when a value in one column of one table corresponds directly to a value in another column in the second table.
In a natural join, the two tables include one or more columns that have the same name and data types. A natural join retrieves all rows from the two tables that have equal values in all matched columns. Frequently, this type of join involves primary key and foreign key columns.
Syntax
SELECT [DISTINCT] * | column [alias], ...
FROM table NATURAL JOIN ;
Joining Two Tables with a USING Clause
The USING clause enables you to specify the columns to be used for a join between two tables. The column names must be the same for both tables and must have compatible data types. Use the USING clause if your tables contain more than one column whose names match to explicitly identify the name of the columns that you want to join.
Syntax
SELECT [DISTINCT] * | column [alias], ...
FROM table1 JOIN table2
USING common_col_name;
Simple Joins
Sunday, January 31, 2010
by
Abdul Majid Niazi
·
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2010
(53)
-
▼
January
(52)
- Creating Groups: Part 1
- Using the Grouping Functions
- Group Functions: Part 2
- Group Functions: Part 1
- Group Functions: Part 1
- Working with Groups of Data
- Using the NVL Function
- Using the NVL Function
- Formatting Dates
- Formatting Dates
- Using Date Functions
- Date Functions: Part 2
- Date Functions: Part 1
- Using Numeric Functions
- Number Functions
- Using Character Functions
- Character Functions: Part 2
- Character Functions: Part 1
- Using Functions to Customize Reports
- Joining Multiple Tables
- Joining Multiple Tables
- Applying Additional Conditions to a Join
- Applying Additional Conditions to a Join
- Joining Tables and Identifying Columns
- Joining Tables and Identifying Columns
- Simple Joins
- Simple Joins
- Joining Tables
- Retrieving Rows
- Retrieving Rows
- Retrieving Columns
- Retrieving Columns
- Writing a Basic Query
- Writing a Basic Query
- Building Queries
- Building Queries: Part 2
- Building Queries
- Accessing Data
- Removing a Copy of a Table
- Removing Tables
- Implementing Business Rules
- Creating Constraints
- Identifying Constraints
- Managing Constraints
- Adding a New Column
- Modifying Tables
- Creating a Copy of a Table
- Creating Tables Using SQL
- Creating Tables by Using the Object Browser
- Creating Tables
- Working with Database Objects
- Relational data base
-
▼
January
(52)
0 comments:
Post a Comment