Join dengan Where
Penulisan join dengan where
select employee. employee_id,
department.department_name
from employee, department where employee.department_id=department.department_id;
JOIN DENGAN ON
select employee employee_id,
departments.department_name,s
from employee join department on(employee.department_id=department.department_id)
USING
select employee.employee_id, department.department_name
from employee join department using (department_id)
untuk menampilkan last_name (nama pegawai) sama nama department
select employee.last_name, department.department_name from employee join department using (department_id)
untuk menampilkan last_name, gajiTahunan, department_name
SELECT E.LAST_NAME,E.SALARY*12 AS GAJITAHUNAN,D.DEPARTMENT_NAME
FROM EMPLOYEE E JOIN DEPARTMENT D
ON (E.DEPARTMENT_ID=D.DEPARTMENT_ID);
Additionals Search Conditions
SELECT e.last_name, d.department_name, 1.city
FROM employee e, department d, location 1
WHERE e.department_id= d.department_id
AND d.location_id=l.location_id;
Menggunakan join
SELECT e.last_name, d.department_name, l.city
FROM employee e join department d join location l
ON (e.department_id = d.department _id)
and(d.location_id= l.location_id)
select employee. employee_id,
department.department_name
from employee, department where employee.department_id=department.department_id;
JOIN DENGAN ON
select employee employee_id,
departments.department_name,s
from employee join department on(employee.department_id=department.department_id)
USING
select employee.employee_id, department.department_name
from employee join department using (department_id)
untuk menampilkan last_name (nama pegawai) sama nama department
select employee.last_name, department.department_name from employee join department using (department_id)
untuk menampilkan last_name, gajiTahunan, department_name
SELECT E.LAST_NAME,E.SALARY*12 AS GAJITAHUNAN,D.DEPARTMENT_NAME
FROM EMPLOYEE E JOIN DEPARTMENT D
ON (E.DEPARTMENT_ID=D.DEPARTMENT_ID);
Additionals Search Conditions
SELECT e.last_name, d.department_name, 1.city
FROM employee e, department d, location 1
WHERE e.department_id= d.department_id
AND d.location_id=l.location_id;
Menggunakan join
SELECT e.last_name, d.department_name, l.city
FROM employee e join department d join location l
ON (e.department_id = d.department _id)
and(d.location_id= l.location_id)
Komentar
Posting Komentar