Home » SQL & PL/SQL » SQL & PL/SQL » Converting format
Converting format [message #19977] Mon, 22 April 2002 10:07 Go to next message
RB
Messages: 11
Registered: April 2002
Junior Member
Hello all,

Is there an easy way in SQL to retrieve/convert a data group that reads:
Record 1
Field1 = Type A
Field2 = $5.00
---------------
Record 2
Field1 = Type B
Field2 = $10.00
---------------
Record 3
Field1 = Type C
Field2 = $15.00

..into a single row retrieve format like:
TypeAValue=$5.00
TypeBValue=$10.00
TypeCValue=$15.00

Thanks,RB
Re: Converting format [message #19978 is a reply to message #19977] Mon, 22 April 2002 10:22 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
1* select ename||' = $' || sal from emp
SQL> /

ENAME||'=$'||SAL
------------------------------------------------------
SMITH = $800
ALLEN = $1600
WARD = $1250
JONES = $2975
MARTIN = $1250
BLAKE = $2850
CLARK = $2450
SCOTT = $3000
KING = $5000
TURNER = $1500
ADAMS = $1100

ENAME||'=$'||SAL
------------------------------------------------------
JAMES = $950
FORD = $3000
MILLER = $1300
Re: Converting format [message #19980 is a reply to message #19977] Mon, 22 April 2002 11:14 Go to previous message
RB
Messages: 11
Registered: April 2002
Junior Member
Thanks for your reply,

I mistakenly did not add that I would like the results to be in separate "field" columns...not 1 string as in your example.

Any ideas?

RB
Previous Topic: decode a range
Next Topic: Bulk Fetch....URGENT
Goto Forum:
  


Current Time: Fri Apr 26 04:30:18 CDT 2024