Friday, November 1, 2013

Pivoting of records(Pivoting of Employees by Department)

In this scenario we will discuss about how to pivot a set of records based on column:
Source Records: 
Dept_id
Emp_name
10
CLARK
10
KING
10
MILLER
20
JONES
20
FORD
20
ADAMS
20
SMITH
20
SCOTT
30
WARD
30
TURNER
30
ALLEN
30
BLAKE
30
MARTIN
30
JAMES

Expected Output
DEPT_ID
EMP_NAME
10
CLARK|KING|MILLER
20
JONES|FORD|ADAMS|SMITH|SCOTT
30
WARD|TURNER|ALLEN|JAMES|BLAKE|MARTIN

No comments:

Post a Comment