Topic: SQL*Plus and PL/SQL >> Reg: JOINS
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| sachin |
Posted: Jan 29, 2008 11:57:46 PM |
Total Post: 2
Joined: Jan, 2008
|
Hi everyone,
I am littele bit confused about JOINS.
Can anyone please explain about joins by taking simple example rather taking from oracle book.
Thanks in advance |
|
|
Nehru |
| Posted: Jan 30, 2008 04:02:52 AM | |
|
Total Post: 46
Joined: Jul, 2007
|
Hi am giving just Introduction only:
Joins A join is a query that combines rows from two or more tables, views, or materialized views.
Oracle Database performs a join whenever multiple tables appear in the FROM clause of the query.
The select list of the query can select any columns from any of these tables. If any two of these tables
have a column name in common, then you must qualify all references to these columns throughout the
query with table names to avoid ambiguity.
Join Conditions
Most join queries contain at least one join condition, either in the FROM clause or in the WHERE clause.
The join condition compares two columns, each from a different table. To execute a join, Oracle Database
combines pairs of rows, each containing one row from each table, for which the join condition evaluates to
TRUE. The columns in the join conditions need not also appear in the select list.
To execute a join of three or more tables, Oracle first joins two of the tables based on the join conditions
comparing their columns and then joins the result to another table based on join conditions containing
columns of the joined tables and the new table. Oracle continues this process until all tables are joined into
the result. The optimizer determines the order in which Oracle joins tables based on the join conditions,
indexes on the tables, and, any available statistics for the tables.
IN WHERE clause that contains a join condition can also contain other conditions that refer to columns
of only one table. These conditions can further restrict the rows returned by the join query.
and furthur Search in NET.
Any one let me know if am wrong.
Take Care.
BYe,
Nehru
|
|
|
|
|
jayesh |
| Posted: Jan 31, 2008 08:05:24 AM | |
|
Total Post: 60
Joined: Jan, 2008
|
while joining tables u have to put on condition unless oracle will display cartisan products.
|
|
|
|
|
pammi |
| Posted: Feb 29, 2008 05:43:32 AM | |
|
Total Post: 21
Joined: Feb, 2008
|
Joins are a means of combining information from more than one table.There are different types of joins
1. Equi Join: A Join based on exact match between one or more columns in two or more tables.
Example:
If i have to display dname along with emp details
select dname,ename from emp,dept
where emp.deptno=dept.deptno;
2.Non Equi Join: a join based on comparision operators other than equality operator
select grade , empno,sal from emp,salgarde
where sal between losal and hisal.
3. Self join: A join that is based on itself
Suppose i need to query the employees who earn same as that of Jones.
select x.ename,x.sal from emp x, emp y
where x.ename<>'Jones' and x.sal=y.sal and y.ename='Jones';
4. Outer Join:
select dname , ename from emp,dept where emp.deptno(+)=dept.deptno;
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 333 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|