Solved

Seperate the rows

Posted on 2014-01-07
2
187 Views
Last Modified: 2014-01-13
Hi,
i have data which looks like below

Table a

code  text                                  lang

101    North America                   E  
102   l'amérique du nord              F


I want output as  

code  text _english      text_french                       lang

101    North America                                               E  
102                             l'amérique du nord              F


how can i do that.

Thanks
0
Comment
Question by:sam2929
2 Comments
 
LVL 14

Expert Comment

by:Farzad Akbarnejad
ID: 39763967
Hello,
Suppose you have your data in tblTest. Write the following query to get proper result:

select t.code, case when lang='E' then text end text_english,
               case when lang='F' then text end text_french,
       t.lang
 from tblTest t

Open in new window

-FA
0
 
LVL 32

Accepted Solution

by:
awking00 earned 500 total points
ID: 39765456
select code, decode(lang,'E',text) as text_english, decode(lang,'F',text) as text_french, lang
from tablea;
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now