I have table in Oracle 11g with 3 fields:
STUDYID | STUDY_PARAMETER | STUDY_VALUE
5268 | Age Group | ADULT (
Since the STUDY_VALUE column appears to be a string, you will need to use either the max() or min() aggregate function on the values:
SELECT *
FROM
(
SELECT STUDYID, STUDY_VALUE, STUDY_PARAMETER
FROM STUDY_INFO
)
PIVOT
(
MAX(STUDY_VALUE)
FOR (STUDY_PARAMETER) IN ('Age Unit' AS AGE_UNIT,
'Age Group' AS AGE_GROUP,
'Trial Type' AS TRIAL_TYPE)
);
See SQL Fiddle with Demo