블로그 이미지
헤이장

Notice

Recent Post

Recent Comment

Recent Trackback

calendar

1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
  • total
  • today
  • yesterday

'db'에 해당되는 글 1건

  1. 2009.07.20 SET 연산자 - 집합
2009. 7. 20. 14:46 Web/DB


*필드의 갯수와 자료형이 같아야한다

※ UNION - 합집합 (공통부분 제외)

select emp.employee_id, emp.first_name, emp.last_name from employees emp, departments dep, locations loc
where emp.department_id = dep.department_id and dep.location_id = loc.location_id and loc.country_id = 'DE'
union
select employee_id, last_name, last_name from employees
where job_id = 'AD_VP' ORDER by employee_id desc;

< 결과 >

204 Hermann Baer
102 De Haan De Haan
101 Kochhar Kochhar

※ UNION ALL - 합집합 (공통부분 모두)

※ INTERSECT - 교집합

※ MINUS - 차집합

posted by 헤이장