Tuesday, October 13, 2009

NO JOINS IN ORACLE

This is what it says in Oracle site. So that's the end point of it. Here are the examples


Using Join Queries: Examples The following examples show various ways of joining tables in a query. In the first example, an equijoin returns the name and job of each employee and the number and name of the department in which the employee works:

SELECT last_name, job_id, departments.department_id, department_name
FROM employees, departments
WHERE employees.department_id = departments.department_id
ORDER BY last_name;

Using Self Joins: Example The following query uses a self join to return the name of each employee along with the name of the employee's manager. A WHERE clause is added to shorten the output.

SELECT e1.last_name||' works for '||e2.last_name
"Employees and Their Managers"
FROM employees e1, employees e2
WHERE e1.manager_id = e2.employee_id
AND e1.last_name LIKE 'R%';


for more info go to : http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2066611

Examples taked from the site.

No comments: