# Databases > Oracle SQL Query

## Sukanta2013

How to convert rows in column using SQL in Oracle;
for example 
 sl_no
  1
  2
  3
  4
output is 1234;

How to convert one column value into rows using SQL 
for example
employee_name
 Kumar 

output 
 K
 u
 m
 a
 r

----------


## suji

Which database you are trying this query.. Here is an example .. 

if you are using Oracle .. have you tried using LISTAGG, over  .. again depends on the version you are using

[IMG]www.geekinterview.com/image/ora6.gif[/IMG]

----------


## muthu_qpt

Nice. Can you say how to get this output in SQL Server ??

----------


## suji

in SQL Server, you can use COALESCE or case combination to get same output ..

or if you are using sql server 2008 , use pivot 

Here is a good example for sql server Convert Rows to Columns

----------

