Home » SQL & PL/SQL » SQL & PL/SQL » SQL Query
SQL Query [message #221944] Thu, 01 March 2007 03:42 Go to next message
babuknb
Messages: 1734
Registered: December 2005
Location: NJ
Senior Member

Hi,

This is my table vaules.

SQL> select * from a;

S Y
---------- ----------
1 2
3 4


I need to reterive records in Row -> column and Column -> Row format. this is possible ?

If possible mean, pls send me the query.


Babu

[Updated on: Thu, 01 March 2007 03:45]

Report message to a moderator

Re: SQL Query [message #221956 is a reply to message #221944] Thu, 01 March 2007 05:22 Go to previous messageGo to next message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
Just asking : what happens if you have 10,000 rows?
Re: SQL Query [message #221961 is a reply to message #221956] Thu, 01 March 2007 05:43 Go to previous messageGo to next message
babuknb
Messages: 1734
Registered: December 2005
Location: NJ
Senior Member

Hellow Michael,

The same qustion asked in my interview. But interivew person told that this is possible or not ?

My answer is No Possible. My answer is correct or not ?

Suppose i have two values in my table, so now to change the column <=> Row ?

Can you tel me.

Babu

Re: SQL Query [message #221979 is a reply to message #221961] Thu, 01 March 2007 06:37 Go to previous messageGo to next message
friendarora
Messages: 24
Registered: February 2007
Junior Member

its possible by using rowtocol function


nitin
Re: SQL Query [message #222015 is a reply to message #221979] Thu, 01 March 2007 08:14 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
rowtocol? What version of the database has that function? Are you from the future?
Re: SQL Query [message #222071 is a reply to message #222015] Thu, 01 March 2007 10:48 Go to previous messageGo to next message
babuknb
Messages: 1734
Registered: December 2005
Location: NJ
Senior Member

Hi,

May i know rowtocol in which version available ?

I can't understand rowtocol function

pls visit " http://dba.ipbhost.com/index.php?showtopic=3264 "

And one more thing. In my table.

EMPNO ENAME

22 babu
22 babu
22 babu

I need this type of format

Rownum EMPNO ENAME
1 22 babu
2 22 babu
3 22 babu

This is possible ?

Babu






Re: SQL Query [message #222080 is a reply to message #221944] Thu, 01 March 2007 12:19 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
Search for the word pivot.
Re: SQL Query [message #222206 is a reply to message #222071] Fri, 02 March 2007 05:07 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Well, I guess that RowToCol will work, but if you have more than a couple of thousand rows, it wont work very quickly.
Previous Topic: date
Next Topic: Can i dynamically create and drop the external tables in the procedure?
Goto Forum:
  


Current Time: Sun Dec 04 12:47:22 CST 2016

Total time taken to generate the page: 0.09518 seconds