Please reply quick

I need to change columns of a table into rows. can we make it if so please give a reply

I need to change columns of a table into rows.http://www.dba-oracle.com/t_display_multiple_column_values_same_rows.htm
- Write a PL/SQL function
You can write a PL/SQL function to display multiple rows values on a single line. Martin Chadderton has written a Pl/SQL function called "stragg" that you can define to display multiple SQL rows on one single line. Once defined, you embed the function within your SQL to display your output on a single line:
select stragg(ename) from emp;
Smith, Jones, Baker
- Use the SYS_CONNECT_BY_PATH operator
This article by Younes Naguib describes how to display multiple values from a single column in a single output row. In his example, he displays multiple values of the last name column on a single row. Note his use of the sys_connect_by_path and over operators:
select
deptno,
substr(SYS_CONNECT_BY_PATH(lname, ','),2) name_list
from
select
lname,
deptno,
count(*) OVER ( partition by deptno ) cnt,
ROW_NUMBER () OVER ( partition by deptno order by lname) seq
from
igribun.emp
where
deptno is not null)
where
seq=cnt
start with
seq=1
connect by prior
seq+1=seq
and prior
deptno=deptno;
DEPTNO NAME_LIST
1 Komers,Mokrel,Stenko
2 Hung,Tong
3 Hamer
4 Mansur
- Use a Cross join
Matt contributed this handy SQL techniques to pivot one row of several columns into a single column with several row, using the Oracle cross join syntax. Matt notes that the Cross join "has other uses in conjunction with a WHERE clause to create triangular result sets for rolling totals etc (though thanks to analytic functions those things are very nice and easy)".
SELECT
ite,
case
when ite = 'item1' then item1
when ite = 'item2' then item2
when ite = 'item3' then item3
end as val
FROM
SELECT
pivoter.ite,
item1,
item2,
item3
FROM
someTable
CROSS JOIN
select 'item1' as ite from dual
UNION ALL
select 'item2' as ite from dual
UNION ALL
select 'item3' as ite from dual
)pivoter
- Oracle analytic Lag-Over Function
Analytic functions have a pronounced performance improvement since they avoid an expensive self-join and only make one full-table scan to get the results. This site shows an example of using the Oracle LAG function to display multiple rows on a single column:
SELECT
ename,
hiredate,sal,
LAG (sal, 1, 0)
OVER (ORDER BY hiredate) AS PrevSal
FROM
emp
WHERE
job = 'CLERK';
Ename Hired SAL PREVSAL
SMITH 17-DEC-80 800 0
JAMES 03-DEC-81 950 800
MILLER 23-JAN-82 1300 950
ADAMS 12-JAN-83 1100 1300
Hope this helps. . .
Don Burleson
Oracle Press author

Similar Messages

  • Graphics card (PLEASE REPLY QUICKLY)

    I have a hp pavilion dv6680et. specs:
    core 2 duo t7700
    2 gb ram
    geforce 8400m gs
    250 gb hard drive
    so my problem is with my graphics card is really bad and i want to change it i can buy all type of cards. Can i change and if i can change how can i?????

    Hi:
    There are no graphics "cards" in your notebook.
    The GPU is soldered to the motherboard.
    You have the best graphics HP installed in that model series, so there aren't even any motherboards with better graphics you can switch to.

  • How do you get adobe photoshop on a second computer? Please reply quickly!!!!!

    How do I get Adobe Photoshop on a second PC when I already have bought it before?

    Unless your photos are stored in a Dropbox or other on-line type file site (as well as your computer) you cannot expect to see them on another computer. The same goes for the catalog.

  • How can I change my security questions but not knowing them please reply burly bought a gift card, How can I change my security questions but not knowing them please reply burly bought a gift card

    How can I change my security question but not knowing them please rePly quick burley bought a gift card..

    Click here for information. If you can't get the answers emailed to you for some reason(the email may take a few hours to arrive), contact the iTunes Store staff via the link in that article.
    (86811)

  • Can I work in Hindi and other Indian languages on macbook laptop? Please reply soon talking in Hindi so that I can buy one quickly.

    Can I work in Hindi and other Indian languages on Macbook? Please reply soon in Hindi so that I can buy it quickly and tell my friends. -R. Kumar, Mobile No. ******
    <Personal Information Edited by Host>

    The support and inclusion of Hindi in the newest OS X 10.10 Yosemite appears to be available.
    Within the setup and installation process of OS X various language options exist in the Installer;
    and regional support for the computers to be set-up with a default language is possible. You
    may find this to be the case, through a local authorized reseller, to buy an Apple product that
    already runs in a local language. The OS X includes more than 20 languages, in the system
    setup. The availability of matching keyboard input devices with a local language may vary.
    •Multi-lingual Mac: recent language addition info
    http://m10lmac.blogspot.com/
    •examples where inference of Hindi support in Mac OS 10.10 appears in articles:
    https://www.google.com/?gws_rd=ssl#q=Mac+OS+10.10+Hindi+language+supported
    As of Lion OS X 10.7, there were 22 languages included in the system, via setup installation.
    More have been added since. You may need to contact regional or local authorized reseller
    of Apple products for specifics and availability of certain items there.
    A historical overview, some details missing, can be read here:
    http://en.wikipedia.org/wiki/OS_X
    You could use the Locator page to find Country, then use City/country and product to see
    the nearest authorized reseller and service businesses along with address & contact info.
    •Apple - Find Locations - Country Selector:
    https://locate.apple.com/country
    The Locator can also be used to find non-Apple branded authorized regional resellers &
    associated service companies; in some cases, they may exist but be difficult to find. These
    usually show in the locate map, with phone number, street address & other contact info.
    Hopefully this may help find the product & service you need.
    Good luck & happy computing!

  • HOW CAN I TRANSFER PHOTOS FROM MY IPOD TOUCH TO MY PC BUT THESE PHOTOS ARE NOT IN THE SAVED POTHOS FOLDER. THEY ARE IN SEPARATE AND DIFFERENT FOLDERS THAT MY DAUGTHER SAVED FROM HER PC. IS THERE ANY FREE WAY TO DO IT. PLEASE REPLY TO JUMACAVA07@HOTMAIL.

    HOW CAN I TRANSFER PHOTOS FROM MY IPOD TOUCH TO MY PC BUT THESE PHOTOS ARE NOT IN THE SAVED POTHOS FOLDER. THEY ARE IN SEPARATE AND DIFFERENT FOLDERS THAT MY DAUGTHER SAVED FROM HER PC. IS THERE ANY FREE WAY TO DO IT. PLEASE REPLY TO JUMACAVA07@HOTMAIL.
    THANKS

    If you need to Transfer photos from iPod to PC,I have a method for your reference,I suggest you use iStonsoft iPod to Mac Transfer software to copy photos from iPod to Mac,a professional software,Not only can you quickly Copy pictures from iPod to Computer,but also can save a lot of trouble and time
    [B]Follow these steps to Transfer photos from iPod to Mac[/B]
    Step 1. Download and run the iStonsoft iPod to Mac Transfer software on your Mac computer
    Step 2. Connect iPhone with Mac
    Step 3. Hit "Photos" to scan photos from iPod to Mac
    Step 4. Click "Photos" button to transfer photos from iPod to Mac
    Step 5. Wait a while,you will success Transfer these photos from iPod to Mac
    How to Transfer/Copy Photos/Pictures from iPod to Mac computer

  • MY TOSHIBA SATELITE A665 - S6050 IS DRIVING ME NUTS! PLEASE REPLY

    THIS IS THE SECOND TIME IM POSTING THIS. PLEASE REPLY . Hi I am a very frustrated 16 year old boy on the verge of pullling out my hair. this is my problem. My grandpa bought this patop last year march , he passed it down to me in may cause hes not much of a tech person, now ever since he gave me this laptop i noticed problems. in the beginning, anytime you move the laptop slighty or pick it up , if theres any audio activity going on , it will stuttter in sync with the vibration of the laptop. i thought it was the harman kardon speakers but till today im still unsure. then came the problem of my ear jack slowly starting to give up . no ear phone plug or headset plug was able to fit in fully and play complete audio, it would only play quarter or halfway in.but i overlooked these problems cause i had a usb speaker and hey, it was a heck of a laptop , then during summer when i travelled to england , the battery pack just all of a sudden got spoiled and it could "no longer hold a full charge" it could only last for little over an hour thirty minutes.so i bought a new battery pack. no problem uh? lets go on . i had a few games on my previous acer aspire one a0522 and since this new laptop had a core i3 processor that prettty much packed a punch i installed most of the games here cause i am a game freak. the games were : fifa 11 , 13 , 14 , pes 2009 2012 2013 2014 , tom clancy's splinter cell conviction , nfs : carbon , hot pursuit , need for speed both new and old ones , call of duty 4 mw , call of duty black ops II , battle field 2142 battlefield 2 , cod mw 2 burnout etc . all the games were running fine varying from low - high quality settings because of the limited vram 64 mb on the intel hd 3000. i also had photoshops cs5 and 6 . now when i resumed school  everything was how it was, sound stuttering ear jack failing , now a new problem arose , whenever the computer gets a slight hit/bang to thr body , the screen goes black and it would either turn off or restart . i didnt understand this so i decided to remove some startups from ms config and all , i left the important things though like the windows 7 common user bla bla things , and the intel start up drivers as well as the realtek hd audio manager . eventually the problem got worse , when i was using it at times the computer would randomly just shutdown and sometimes it would not come on for hours to almost a day (whever i put it on the screen is just black and the hdd light does not light up) and sometimes it will come on immediately i press the power button . so i was obviously frustrated but managing with the laptop . so eventually the problem got so bad that whenever the computer started up and i ran a program , immediately the fan kicked into full speed , 5 seconds after the thing would just go off on its own , regardless of what program it was , i finally had enough and took it in for repairs . they serviced it and brought it back , everything was fine for one week then the problem started again , everything came back . so this time i went with the laptop for repairs myself and they told me the cpu was the problem that it needed replacement , another shop told me it was the cpu mother board and fan that had problems . so i dont know who to believe. BUT HERE IS A PECULIAR THING. when  i run the laptop on one core (disabled multi core processing in bios) of course the cpu isnt running at full capacity but on that one core it runs for hours fine without shutting down , but it makes some games slow cause not all cores are in use .so i decided to re enable multi core processing and did this : whenever i start a program i immediately go into my task manager and set the affinity of any running programs to one core only (usually cpu 0 in windows 7) then set the affinity of the program i just launched myself to either cpu's 1 ,2 or 3 NOW THIS PROCESS IS WORKING FOR ME SO FAR but i dont know how long it would last and when i run games like fifa 13 o=with this process it plays fine but sometimes it quits in match and there is constant audio lag , but most other games run fine . i downloaded hot cpu tester pro and did the ram test , everything was fine , benchmark test , everything up to standards , but when i did the cpu test (where the test utilises the cpu to a 100% and i know it does cause i can see the cpu usage in the status bar in tassk manger) when the test goes into 15 seconds the laptop goes off again like it used to . so my conclusion is my cpu is the problem but i am still not sure so i am posting this . please help guys. thanks i have done the full system recovery process 3 times but all the problems remain. i am in africa and have limited resources please help.
    specs 
    satelite a665 - 26050
    intel core i3 350 m 2.27ghz
    ram 4 gig 3.80 usable
    64 bit windows 7 home premium 
    intel hd 3000
    downloaded lates bios update from toshiba site here (problems were here before i updated bios , bios update didnt fix anything)
    intel hd 3000 driver - 8.15.1993 - 2010

    Probably this one. 
    Satellite A665-S6050 (PSAW0U-01100G)
    -Jerry

  • My I-cloud says I have no devices set up even when i'm logged in to my apple , how do I fix this problem? Please respond quickly, I lost my ipod and even when I try to place it in lost mode it still won't recognize that I have a device. What do I do?

    My I-cloud says I have no devices set up even when i'm logged in to my apple ID account, how do I fix this problem? Please respond quickly, I lost my I-pod and even when I try to place it in lost mode it still won't recognize that I have a device. What do I do?

    If you did not set up find my iPhone on the iPod, you can't find it.

  • I would like to send pics from my windows computer to my iPhone using bluetooth. I had it paired but somehow it cannot the download the software and is asking to usa a disk instead. Where or how can I download the software available for that, please reply

    I would like to send pics from my windows computer to my iPhone using bluetooth. I had it paired but somehow it cannot the download the software and is asking me to usa a disk instead. Where or how can I download the software available for that, please reply... thaks. (",)

    Bluetooth file transfer has never been supported with iOS devices.

  • Explain exactly how to get video on my ipod PLEASE REPLY

    yea ive been trying to figure it out but im really bad with computers so i bsaically have no idea what to do and also i have a another question.... now since the new itrips go into ur dock connector how am i supposed to charge it in the car. PLEASE REPLY because im starting to think if i should just give this one back and get my photo back

    For video, since you're on Windows, you're going to want to look at using Videora iPod Convertor.
    To use Videora iPod Convertor to convert movies for use on your iPod, consult these helpful links:
    To get started: Videora iPod Convertor Guide
    If you have questions: Videora iPod Convertor Frequently Asked Questions
    If you have more questions, post them here: Videora iPod Convertor Forum
    Note that Videora iPod Convertor is a 3rd party program. If you need help with it, post your question there.

  • Is it possible to export contacts  from Outlook 2011 for Mac and importing this file back into Mac Address Book.? please reply me its urgent

    Is it possible to export contacts  from Outlook 2011 for Mac and importing this file back into Mac Address Book.? please reply me its urgent

    Is it possible to export contacts  from Outlook 2011 for Mac and importing this file back into Mac Address Book.? please reply me its urgent

  • Please reply ASAP

    Hi
    I have Microsoft Windows Server 2003 R2 standard X64 Edition.I tried to install oracle 9i(9.2.0.1 32 bit for windows) on this server but installation was never successful. Do i need to go for a Oracle 9i(9.2.0.1 64bit for windows) or any other problem? Even i completely remove windows server and reinstall it completely but still problem is there. Please reply me ASAP as this is our production server.
    Thanks.
    Regards,
    RJ.

    From Oracle:
    32-bit Information
    Currently this platform is ONLY certified 32-bit Oracle on a 32-bit operating system.
    There is only 32bit 9i available for 32bit OS on this platform, even if hardware architecture is 64bit. So you need either Windows 32bit or you have to go for 10g.
    Werner

  • .PLEASE REPLY. is the ios6 out? btw Siri is it only ipad 3? or also ipad 2. cus i only have ipad 2. PLEASE SAY IT WORKS ON ipad 2!!!!!!!

    PLEASE REPLY. is the ios6 out? btw Siri is it only ipad 3? or also ipad 2. cus i only have ipad 2. PLEASE SAY IT WORKS ON ipad 2!!!!!!!

    thanks i actually knew it. i just wished and hoped that it would work on ipad 2 and thought .*** THIs... i dont even know what im saying

  • PLEASE REPLY! HELP TRANSFERING SONGS

    Well, I decided that I needed to make my main libarary at another computer, so I plugged in the ipod at the new computer and went through the steps. All the songs that I had bought from iTunes appeared, but none of the songs I had uploaded from CD's. How do i get those songs on my libary without deleting them from my iPod when updating? Please Reply, it's much appreciated.
    ~ Rebecca.

    Hi Rebecca,
    If iTunes is displaying a message to you, asking if you would like to "Erase or Sync", please be sure to click on "Cancel" and not "Erase and Sync"; this will delete all of your other music off your iPod.
    After you've done that, click on your iPod's name in the Source List, and under the "Summary" tab, tick the "Manually manage" option for your iPod. Click the “Apply” button in the bottom-right corner to save your changes.
    Now onto the transferring.
    There are a few different ways to copy your iPod's songs to your computer, but probably the most straightforward method is to download a third-party program that can copy the songs from your iPod to your computer.
    I would suggest that you try YamiPod. It's free, and I've heard it recommended a lot.
    -Kylene

  • HI is updated iOS 7.1.1 show full screen contact image??? I'm going 2 update and tell me wat kind of features updated in iOS 7.1.1 please reply me

    HI is updated iOS 7.1.1 show full screen contact image??? I'm going 2 update and tell me wat kind of features updated in iOS 7.1.1 please reply me

    No, when you get a call it's a small round image of your contact if you have set it up.
    http://support.apple.com/kb/DL1736

Maybe you are looking for