How to merge continuous same data in one and then change.

Hi all

I have a look of table as shown below.

City of day code
01 Delhi A001
Delhi 02 A001
Delhi 03 A001
London 04 A001
London 05 A001
Delhi 06 A001
07 New York A001
08 NYC A001
.....
...
...
..
and so on

Now I want to merge column 1 column with order by the gaze of day and exit as City... Delhi - London - Delhi - New York - where code = "A001".

Please help me with this problem.

Thank you
Neo

Published by: user11809081 on Sep 3, 2012 10:35

Published by: user11809081 on Sep 3, 2012 10:36

In case you are looking for an alternative approach to conect by

WITH data AS
        (SELECT '01' day, 'Delhi' city, 'A001' code FROM DUAL
         UNION ALL
         SELECT '02', 'Delhi', 'A001' FROM DUAL
         UNION ALL
         SELECT '03', 'Delhi', 'A001' FROM DUAL
         UNION ALL
         SELECT '04', 'London', 'A001' FROM DUAL
         UNION ALL
         SELECT '05', 'London', 'A001' FROM DUAL
         UNION ALL
         SELECT '06', 'Delhi', 'A001' FROM DUAL
         UNION ALL
         SELECT '07', 'New York', 'A001' FROM DUAL
         UNION ALL
         SELECT '08', 'New York', 'A001' FROM DUAL
)

select
 code
,max(city_concat) keep(dense_rank last order by day) city
from (
select code, city_concat, day
from data
model
partition by (code)
dimension by (row_number() over (order by day) day)
measures (city, cast(null as varchar2(4000)) city_concat)
rules
(city_concat[day] order by day
=case city[cv()]
when nvl(city[cv()-1],city[cv()])
then nvl(city_concat[cv()-1],city[cv()])
else city_concat[cv()-1]||' - '||city[cv()]
end
))
group by
code

CODE CITY
A001 Delhi - London - Delhi - New York 

Published by: chris227 on 03.09.2012 02:12

Tags: Database

Similar Questions

  • Unable to disable UAC errors: to continue, type an administrator password, and then click Yes, but he is nowhere to type a password and Yes is disabled.

    Original title: to continue, type an administrator password, and then click Yes, but he is nowhere to type a password and Yes is disabled.

    Yesterday I just reinstalled Windows 8, replacing the preview of the version and the official version.

    I would like to disable UAC and various other things, but I can't.
    Do you want the following program to make changes to this computer?
    Control parameters of account user (or almost anything from the control panel)
    To continue to type the administrator password, and then click Yes.
    There is no area password to type in. He 'bumps' when I type. I can only click on the No button or display unnecessary details.
    I will not restore the system on a new installation. Apparently, it's an old bug that has never been fixed because you can just tell people to do a system restore and close the book on the complaint. If please post a proper fix and stop wasting users time.
    Hi, I know I'm a little late to the party, but I found this post faced a similar problem and thought that post my findings.
    I found a work around for this problem, which does not require a reinstall of Windows, but you may lose your user account.
    Summary:
    The problem is that in Windows 8, the administrator is inactive by default, you will have to find a way to activate it. You can enable the admin account as an administrator,.
    However. Fortunately, (on my machine anyway) it seems that you can access your hidden from the Safemode administrator account. If your first set of objectives will be as follows:
    -starting in safe mode
    -Log in as an administrator
    -l' administrator, enable the account administrator similarly.
    -Restart your machine and you as an administrator outside of safe mode (normal mode).
    From here, you should be free to do what you want. Now that the admin account is active, you are allowed to type a password when prompted (by default that the password is empty). For me, however, when I tried to promote my previous user administrator account (among other things) I noticed symptoms that seem to indicate that the account ceased to exist. I went through measures to set up a new account and get it synced with my microsoft email account.
    -Create a new user account
    -give administrator rights
    -remove my old (for some reason, hidden) account
    -Sync to the top of my new user account with microsoft e-mail account.
    Directions for use:
    How to get admin access:
    (1.) start in safe mode. You can make it easier by opening a command prompt (Start menu-> type "cmd"). And type "shutdown/r/o".
    2.), your computer begins to restart, but give you a set of troubleshooting options. Choose troubleshooting->-> start of the Advanced Options settings.
    3.) after reboot and enter safe mode, users of contactor by going to the start menu-> click on your user name-> and choose administrator.
    4.) Windows will begin the first initialization for this account.
    5.) once connected, open the command prompt, this time as a Director. (Make a right click-> Run as administrator).
    6.) type "net user administrator / Active: Yes" to set the admin account as 'active'. It will now be shown outside of safe mode.
    7.) restart your computer and log in as administrator again. You can now add users and to play with the permissions etc. (metro options are not available in safe mode, where the reset).
    How to remove your old account of 'lost' and synchronize your new account with the microsoft account.
    1.) create a new account via the control panel users. Don't forget to give you administrator rights.
    (2.) to remove your lost old account by typing "net use /del" in an administrator command prompt. You need to know your old account name, good luck with this one.
    3.) go into the settings of your pc: open the context menu on the right-> settings-> "change PC settings."
    (4.) to go to the users-> Select 'switch to a Microsoft account» tab
    I hope this helps!
  • How to ensure that my computer has microphones and then use them for talking to Cortana?

    How to ensure that my computer has microphones and then use them for talking to Cortana?

    Hi Walter,

    Please start by http://windows.microsoft.com/en-us/windows-10/cortana-privacy-faq

    Also, try to review this tutorial: http://www.tenforums.com/tutorials/4026-cortana-turn-off-windows-10-a.html

    They should help you get started.  Problems specific to the micro (existence, activation, volume,...) will be addressed (more than the troubleshooting steps if Cortana doesn't) that you go through the above; However, a "one-stop-shop" for microphones & recognition recording & speech covering all peripheral aspects are versatile control panel page (see the path in the blue header at the top of the screenshot pictured below for W10Pro 11102).

    Best wishes

    Kosh

  • It might make me totally distracted, but in the password protocol, it seems all sites want one and then somehow I've now changed my passwords?

    Hello

    It might make me totally distracted, but in the password protocol, it seems all sites want one and then somehow I've now changed my passwords? IE: Google, Microsoft...

    Some people say that I need only a pswd for all sites?

    Some say all change every month... you, the experts say?

    Thank you

    Hello

    One of the worst things you can do with passwords is to have the same password for everything. For example, someone like a hacker finds your password by e-mail. You can use the e-mail address as username for several things, such as the online stores, financial sites, etc.. Once they know this address combination and e-mail password works on a single site, hackers can try on many popular sites. You are then not only your email hacked, but a lot of things.

    There are more tips here:

    http://www.microsoft.com/en-GB/security/online-privacy/passwords-create.aspx .

  • Need help to open two images with the same file with different exposures on the screen at the same time in the Photoshop creative cloud (in previous versions we could open two images of the same nef (raw) file and then combine them on the screen with the

    Need help to open two images with the same file with different exposures on the screen at the same time in the Photoshop creative cloud (in previous versions we could open two images of the same nef (raw) file and then combine them on the screen with the move tool. They have become a composite of two layers which could be developed further with the mask tool.

    Hello

    Please go to the preferences > workspace and uncheck the option 'open the document in the tabs '.

    Now you can click on file and choose file > open and open the two images in two different windows which can be arranged side by side.

    Thank you

  • How to duplicate a layer and then change the adjustment layer?

    This used to be easy to PS7, but he is evasive in CS4. Sometimes we need to duplicate a layer, then change the adjustment layer. For example, we may have selected a portion of an image and used the brightness contrast and then we need to create a new layer using the same section using selective correction. What we have done in the past, is to duplicate the layer, and then change the adjustment layer. Any ideas?

    Create your new adjustment layer. Option drag the mask layer on the new original setting, and then choose replace.

    Beware of the many similar masks:

    http://www.teddillard.com/2008/10/Geekzone-rosenholtz-Sanchez-effect.html

  • I need several Web sites with different models but the same data. (Headers and footers different no body)

    I use Dreamweaver 20141. I do it literately tons of sites and each has hundreds of pages, so I need a way almost drag and then just change the links which would make things go a lot faster. Data or the body is going to be the same as the model data.

    Use the SSI (SSI) to put the code of the repetitive content body in a separate include file.

    Build your various pages with unique headers and footers, and then "call" content with a PHP link.

  • How can I download the backup on Mac and then restore it via iTunes?

    The STRP to restore stuck on "remaining time: estimation...» "So I would like to download the backup on my Mac and then restore it via iTunes.

    This can be caused by a corrupt existing backup that should be deleted, or data on the device that causes the backup fails.  To resolve these issues, try to clear your last backup (if you a) by disabling the iCloud backup in settings > iCloud > storage and backup, and then press on managing storage, type on your device under the backups, and then click Delete backup.  Then go back and turn iCloud backup and try to save again.

    If it don't always make a backup, you may have an app or something in your camera roll which causes the backup fails.  To find one, go to settings > iCloud > storage and backup > manage storage, tap the name of your device under backups under tap Backup Options show all Apps, turn them all off (including film) and then try to save again.  If the backup was successful, then the camera or one of your applications is originally the backup fails and you must located by the process of elimination. Turn on the film and retry backup.  If it succeeds, some of your applications to turn on and try saving again.  If it succeeds once again, turn it back on a few apps more then try; Repeat this process until it fails.  Finally, you will be able to locate the app problem and exclude from your backup.

  • How do remove you audio from a video and then use an audio of a different video to put in the first video?

    I have a video with good quality video but audio very bad, but I have another video of the episode even with the bad video but the sound quality. How can I remove the audio good video bad and replace it in the latest version of Windows movie maker on Windows 7 with audio video bad?

    Basically, you need to capture the sound quality to a separate mp3 file outside the filmmaker and then delete the wrong audio track and the good idea of layering.

    According to the source, this could be as simple as recording audio reading even if you end up with poor quality than the one you want to replace. If a file, it is possible to upload a video to mp3 converter.

  • How find specific text in a text frame, and then replace it?

    Hello

    I am currently using InDesign CC, specially the script part, for updating a price list for my company.

    I have a table that contains all of the blocks of text in my document. A page use a block of text. I want to go through all these text block, find a Word and then replace it with the word I want.

    Example: The line, in a text frame that contains several line, ' CAR56974 - $14.95 "must be the change of ' CAR56974 - $ 18.66»

    I want to find this line in all my text frames, and then replace it with the new line.

    I looked in the forums but cannot find an answer for my problem specfic.

    Here's how to get all my text blocks:

    var allTextFrames = myDoc.textFrames;

    for (var i = 0; i < allTextFrames.length; i ++) {}

    TF = allTextFrames [i];

    }

    Thanks in advance!

    Olivier

    EDIT: I use JavaScript.

    Hi Oliver,.

    Can the underside of coding work for you.

    app.findTextPreferences = app.changeTextPreferences = null;
    
    app.findTextPreferences.findWhat = "CAR56974 - $14.95";
    
    app.changeTextPreferences.changeTo = "CAR56974 - $18.66";
    
    app.activeDocument.changeText();
    

    Thank you

    Beginner_X

  • How can I open with an animated gif and then go to the home page?

    I'm sorry for the newbie question, but I would like to have an intro of gif hosted on a web page. Is it possible to have the gif game and then go to the index file? Or I have to insert the gif into an index file and save the homepage like something different? If so, how to go to the home page automatically?

    Any help is appreciated.

    Thanks for the help.

    I agree... I don't necessarily like the animated intro, but he asked the person that I created the site for. I didn't use the flash because of the possibility that people do not have it or have it turned off and I thought this would be an easier option. Thanks again.

  • How to merge storage of data 3

    Dear Sir / Madam,.

    I installed ESX 3.5 on one of my server G4 DL350 now I want to merge 3 storage of data for coming one because I want more space for a virtual computer as over 400 GB.

    Screen short is attached for your kind information.

    Your help is required.

    Principle systems engineer

    NetSol Technologies

    Lahore Cantt Pakistan

    54792

    Thank you very much for your answer... we can configure RAID on it?

    As the writing above, you need to create the RAID at the hardware level (it is not a function of the software RAID in ESX).

    Also make sure that each logical drive that you create is<>

    André

    * If you found this device or any other answer useful please consider awarding points for correct or helpful answers

  • How to put all the data into one phone to another?

    Okay, so I have an iphone 5 c and I want to spend it with old iphone my mother 5 s. I want to move all the data from the 5 c to 5 s. but I don't know how to do it? I'm sure that you connect the 5 c with itunes on a computer to do. Help?

    You can do it. First of all, make sure that the 5s are deleted properly: what to do before you sell or give away your iPhone, iPad or iPod touch - Apple Support

    Then you can transfer the contents of the 5 c to 5 s: transfer content from your old iOS device to your new iPhone, iPad, or iPod touch - Apple Support

  • How can make us big data from one database to another db

    Hi all

    I have 540,00,000 records in a table. Use dblink when I try to extract data in the database for this table in another table to it-error. Is someone can you please tell me how I can extract data from table A in db1 that has 540,00,000 records in table A which is located in db2 and is empty.

    Kind regards

    Amrit

    You can also consider an insert in direct path, possibly with active parallel.

    Insert / * + append * / in...

  • How to merge several PDF files into one file

    plans that are sepperate pdf pages and need to put them all on a single file to work with

    Help, please

    Files can be combined, if appropriate, to organize Pages, the Pages palette or create a PDF > from multiple files.

    Not agree to the following:

    -secure files

    -signed files

    -the files that were active player

    -fill in forms of all kinds

Maybe you are looking for

  • Refurbished iPhone what is mine?

    Can someone explain to me what kind of refurbished iphone I have? I got this product with normal packaging and not the area of usual plain for Apple certified one of opportunity. But in the back, I got this label. I had original accessories as well a

  • Cannot use the network after the first time backup volume machine

    Hello After the update to OS 10.11.4 my MACs are unable to use the network backup volume more. The volume of time machine is a device (RAID of LCM InXtron Taurus-S) external USB connected to a server of iMac (also running OS 10.11.4). Four MACs use t

  • HP p6-2464eo with the startup problem!

    Hello! I read somewhere this problem s with usb 3.0 to start from, but with my computer is usb 2.0, a problem also. It s works fine when the computer is operational in the running, but I want to change my hard drive and I give up soon! I tried to mak

  • Case of Structure / while loop problems

    Hello I am trying to write a code that draws a random number whenever a key is pressed.  The chart must be a random number on the y axis and the number of times that the button is pressed on the x-axis.  I want to draw the last twenty random numbers.

  • Impossible to decrypt the EFS file

    Dear all, I encrypted contents of a folder, and its color turned green. I need to install a new fresh Windows version 7. Now, when I try to remove the check mark on "Encrypt contents to secure data", I first get the message "you will need give the ad