Tuesday, August 25, 2015

Column to Row Chnages in Oracle :


# How to Change the  Column to Row.
# Using PIVOT Operator :

 Pivot operator is display the data in column which all takes from row. this operator use for cross tabulation and give you the result in row to column format.

SELECT * FROM (SELECT first_name, last_name FROM employees) PIVOT (SUM(salary) AS sum_salary FOR (first_name) IN (1000,2400,17000));




SELECT REPLACE(Testbulk, ' ') FROM (SELECT SYS_CONNECT_BY_PATH(Testbulk,' ') Testbulk, level  FROM T1
START WITH Testbulk= (select min(Testbulk) from t1) CONNECT BY PRIOR Testbulk < Testbulk ORDER BY level DESC) WHERE rownum = 1;

No comments:

Post a Comment

Installation of Oracle 11g and 12c *Kindly see the You Tube video to get installed the database.