Merge statment doesnt work

Hi all.
I have 2 tables for the merge:
CREATE TABLE DAM_ACCESOS_LASTLOGIN
FECHA DATE,
USUARIO VARCHAR2(100)
TABLESPACE COLOSO
CREATE TABLE DAM_ACCESOS_LASTLOGIN_STAGE
FECHA DATE,
USUARIO VARCHAR2(100)
TABLESPACE COLOSO
Atm DAM_ACCESOS_LASTLOGIN is empty and i im trying to populate it with the data from DAM_ACCESOS_LASTLOGIN_STAGE. For that im using a merge statment like this:
merge into dam_accesos_lastlogin f
using dam_accesos_lastlogin_stage s
on (f.usuario=s.usuario)
when matched then
update set f.fecha=s.fecha
when not matched
then insert (f.fecha,f.usuario)
values (s.fecha,s.usuario);
The DAM_ACCESOS_LASTLOGIN_STAGE have 29 millions rows, and sql said only 2millions have been merged. But when i select DAM_ACCESOS_LASTLOGIN instead of date,user only one time i have the same user with distinct dates.
For example:
30/10/2007|[email protected]
01/11/2007|[email protected]
28/10/2007|[email protected]
26/10/2007|[email protected]
24/10/2007|[email protected]
23/10/2007|[email protected]
25/10/2007|[email protected]
21/10/2007|[email protected]
22/10/2007|[email protected]
29/10/2007|[email protected]
16/10/2007|[email protected]
04/11/2007|[email protected]
Im trying to have only one date and one user on DAM_ACCESOS_LASTLOGIN , and update the date if the user existes in DAM_ACCESOS_LASTLOGIN_STAGE, but dunno why dont work
In DAM_ACCESOS_LASTLOGIN_STAGE i have same user, diferent dates and in DAM_ACCESOS_LASTLOGIN only want one date x user.
Any help will be awesome.
Thanks
Message was edited by:
user496863

The merge statement does not row by row processing, it is doing all at once.
If you have the same user multiple times in your start table DAM_ACCESOS_LASTLOGIN_STAGE, then it will insert it multiple times.
To avoid it you should select each user only once, e.g.:
merge into dam_accesos_lastlogin f
using (select usuario, max(fecha) fecha from dam_accesos_lastlogin_stage group by usario) s
on (f.usuario=s.usuario)
when matched then
update set f.fecha=s.fecha
when not matched
then insert (f.fecha,f.usuario)
values (s.fecha,s.usuario);Btw: I like the name of your tablespace! COLOSO is much better than my usual DATA_HUGE.

Similar Messages

  • I have an ipod touch 4th gen and I have songs on it which I cannot remove, even when I sync it and untick the songs they will not remove from the ipod, doesnt work manually either, help

    I previously had an ipod nano but now have an ipod touch, when I synced it for the first time I got songs on to the ipod which I dont want, I have tried unticking them in itunes library and this doesnt work.  I have also tried going to summary to remove manually but it doesnt show any songs in this box to be removed.  Can anone help please.

    Is your device recognized by your computer? If yes, copy the pictures and videos as shown in this article:
    Copying personal photos and videos from iPhone, iPad, or iPod touch to your computer
    If it is not recognized, try this first: iOS: Device not recognized in iTunes for Windows
    Disable autosync in iTunes, right click on it in the device list and choose "transfer purchases" to copy apps and other media bought in iTunes to your new library.
    Do the same again and choose "backup", to create a manual backup without syncing.
    Since your device will be erased due to the new iTunes library during the first sync, you can use this backup afterwards to restore your settings and data.
    Set up at least one contact and event on your computer before you start, to be able to merge calendars and contacts.

  • HELP in Merge statment

    due to some issue its removed.
    NIL

    I heard that the MERGE statement inserts some rows and updates others in a single operation.It seems that doc confirm that you heard well, obviously.
    Take a look to the documentation :
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9016.htm#SQLRF01606
    In this way can the following query can be wrritten using the MERGE statment.Hmmm, how quite huge are your queries... I won't take all my (work) day to try to write a merge for you, maybe you can try it yourself ?
    Nicolas.

  • VISUALSVN - merge branch dont work in jdeveloper 11.1.2.1.0

    I am using jdeveloper 11.1.2.1.0
    I want to update my branch with trunk revision so i select branch as current application then i select versioning>merge
    -MERGE SELECTED REVISION RANGE
    URL TO MERGE FROM: I select here my trunk directory
    https://daguirre-virt/svn/Biblioteca/trunk/Biblioteca
    REVISION RANGE i select my last revision: 17
    And i get this message:
    merge dry-run depth=infinity -r 17:17 https://daguirre-virt/svn/Biblioteca/trunk/Biblioteca C:/ACTSIS/Aplicativos/Biblioteca_1.1/Biblioteca.jws
    Dry-run merge complete.
    merge --depth=infinity -r 17:17 https://daguirre-virt/svn/Biblioteca/trunk/Biblioteca C:/ACTSIS/Aplicativos/Biblioteca_1.1/Biblioteca.jws
    Merge complete.
    The problem is that it doen´t update my working copy... If i do same procedure with tortoiseSVN client it work but doesnt work with jdeveloper.
    What could be the problem??

    You can't use 11.1.2.3 for portlet creation.
    You need 11.1.1.6 and then use the help->check for update option in the menu to get the WebCenter extension.

  • Related Link doesnt work with Multiple Helpsets

    Robohelpx4.1 is used as the authering tool to generate our help files in OHW format. We have different projects creating one helpset file each and it is merged in the ohwconfig.xml. Each helpset has its own link,map,index,Toc files created by robohelp. The link file created by robohelp has the linkitem id created in seq order and names as Link01,Link02,Link03..... .
    The link file of other helpset also has the same structure and ids. (The linkitem id's are not unique across the helpsets)
    But the related link doesnt work properly when more than one helpset is configured, for both the options of combined book and separate books. Links get mixed up and shows topics of other links.
    Is there anyway this can work ?

    Link Problem with Multiple Helpsets

  • LinkedList toArray() doesnt work well

    toArray() doesnt work as expected
    any suggestion?
    thx~
    >
    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.Integer;
         at util.ArrayUtil.main(ArrayUtil.java:22)
    {quote}
    package util;
    import java.util.*;
    public class ArrayUtil
    {   public static <E> E[] merge(E[]... e)
        {     LinkedList<E> ll = new LinkedList();
         for(E[] e_temp : e)
         {   if(e_temp == null) continue;
             for(E e_temp2 : e_temp) if(e_temp2 != null) ll.add(e_temp2);
         return (E[])ll.toArray();
        public static void main(String[] args)
        {     Integer[] a1 = null;
         Integer[] a2 = null;
         Integer[] a3 = {1,2,3};
         Integer[] a4 = {4,5,6};
         Integer[] a = (Integer[])merge(a1, a2);                //ClassCastException is triggered
         System.out.println(a.length);
         for(int i=0; i<a.length; i++)
         System.out.println(a);

    could you pls show me a sample?
    public static <E> E[] merge(E[]... e)
        {     LinkedList<E> ll = new LinkedList<E>();
         for(E[] e_temp : e)
         {   if(e_temp == null) continue;
             for(E e_temp2 : e_temp) if(e_temp2 != null) ll.add(e_temp2);
         E[] out = (E[])Array.newInstance(e.getClass(), ll.size());
         return ll.toArray(out);
        }Exception in thread "main" java.lang.ClassCastException: [[[Ljava.lang.Integer; cannot be cast to [Ljava.lang.Integer;
         at util.ArrayUtil.main(ArrayUtil.java:23)
    {quote}

  • MSI GF4 Ti-4200 doesnt work with WindowsXP

    I can't get the MSI display tools to work - it crashes,
    the vbios.dll doesnt load, it also crashes.
    the tv in doesnt work ,it crashes
    the tv out doesnt work ,it crashes.
    all the supplied software also crashes "application has encountered an error and cannot continue. sorry for any inconvenience"
    the intervideo software (windvr, wincoder, winproducer) and MSI PVI software all crashes as well.
    what's the deal with this stuff?  ?(
    I have a Dual AMD athlon Tyan thunder k7 motherboard,
    MSI Ti-4200-VTD video card and MSI tv anywhere card.
    is there any resolution for this?

    I'm sorry gfilitti if I don't have my system listed, but I thought my question was pretty simple...
    Has ANYONE been able to make the InterVideo WinProducer 2 software, that comes with the retail version of the MSI G4Ti4200-VTD64 card, work successfully under the Windows XP Home or Pro operating system?
    If the answer is YES, then I will begin investigating why my system can't.
    If the answer is NO, then I only ask for other people's recommendations of what software WILL work in place of that. I NEED those functions to work. That's why I paid extra for the VIVO.
    All we've heard so far in this thread are NO votes. I would like to see just how widespread this is. If I can find ONE person who claims it works fine on his/her computer under Windows XP, then my NEXT question would be if they had to do anything different to make it run, or was it just a straight install? Did they add the program patch available from the MSI website? See where I'm going with this?
    If you would REALLY like my system details, here ya go...
    ========================================
    CASE - ANTEC SX1000II with 4 internal 8cm fans
    POWER SUPPLY - ANTEC 400W "True Power" w/dual fans
    MOTHERBOARD - MSI 645E MAX (MS-6547 Ver 2.0)
    BIOS - AMI Ver 3.2 (10/21/02)
    PROCESSOR - PENTIUM 4 2.0aGHz (Rev/Step 2/4(9) )
    MEMORY - 1 Corsair 512MB DDR RAM (Winbond chips)
    DISABLED IN CMOS - FLOPPY Controller, AUDIO Device, MODEM Device, Serial Port B, MIDI Port, and GAME Port
    AGP SLOT - MSI G4Ti4200-VTD64 - IRQ 16
      DRIVER: MSI 31.00
      CAPTURE DRIVER -  nVidia 1.08
    SLOT 1 - Creative SB0090 Audigy Sound Blaster - IRQ 17
      DRIVER - Creative 3.0.0.18 9/20/02
    SLOT 1 - Creative SB1394 FireWire Controller - IRQ 18
      DRIVER - MS 5.1.2535.0 7/1/01
    SLOT 2 - NIC #1 D-Link DFE-530TX Ethernet - IRQ 18 (LAN)
      DRIVER - REALTEK RTL8139 5.396.0530.2001
    SLOT 3 - Adaptec 29160N Ultra160 SCSI Controller - IRQ 19
      DRIVER - Adaptec 6.2.0.0 3/19/2002
    SLOT 4 - EMPTY
    SLOT 5 - MSI SYSTEM D-Bracket
    SLOT 6 - NIC #2 NetGear FA312 Ethernet - IRQ 18
      DRIVER - Windows XP Pro native driver
    NOTE:
    NIC #1 is for home LAN
    NIC #2 is for Alcatel SpeedTouch External DSL modem
    SCSI DRIVES:
    ID 0 - COMPAQ (Seagate) ST318451LW, 18GB, 15K RPM
    ID 1 - QUANTUM Typhoon Atlas II, 18GB, 10K RPM
    ID 2 - Seagate ST39103LW, 9G, 10K RPM
    ID 3 - Plextor CD-RW PX-W1219S
    ID 4 - Toshiba DVD-ROM SD-M1201
    ID 5 - EPSON Perfection 1640SU Flatbed Scanner
    ATA/ATAPI DRIVES:
    Primary Master - No Connection
    Primary Slave - No Connection
    Secondary Master - MATSHITA LS-120 Ver F523
    Secondary Slave - No Connection
    USB DEVICES:
    DIAMOND SupraMAX 56K V.92 Model:SUP2920
    Generic Flash Memory programmer and other assorted USB devices on occasion.
    MONITOR - HITACHI SuperScan Pro 21 w/5-BNC input
    ========================================
    BTW, I would think when investigating a program's FLAT refusal to run, that the MOST important things aren't listed in these signature files. It has to do with what ELSE is running at the same time. Which services are running and which are NOT? What memory resident programs are loaded at boot-up? Any service packs installed? How about any security patches from Microsoft? Which anti-virus software (if any)? Which DirectX version? Personal firewall? Etc., etc.
    Granted, the hardware DOES have a factor, but I feel all of these are MORE important factors than the speed or brand of a persons hardware. I look at the signitures more as bragging rights than anything else.
    Now, this is just my opinion and may not reflect the feelings of the more sane people around me.  
    Cheers!

  • Macbook pro 15" mid 2010 i spilled water on keyboard now it wont power on if the battery is connected and the keys on keyboard doesnt work it works fine with no battery and external keyboard if i order a battery and new keyboard will every else work again

    macbook pro 15" mid 2010 i spilled water on keyboard now it wont power on if the battery is connected and the keys on keyboard doesnt work it works fine with no battery and external keyboard if i order a battery and new keyboard will every else work again lik it did before

    If you have records that show that you've taken your MacBook Pro in for a year to fix the machine, I would escalate the problem to Apple Customer Relations - unfortunately I don't have a number for Spain.
    It would only seem logical to me that if you've been trying to have the machine repaired during the time that the 'recall' was in effect that you should be eligible for a new logic board. But only customer relations will be able to make that call.
    Good luck - take the issue as high up the food chain as you can and see what happens.
    Clinton

  • On Safari, ipad connects to the internet.  But when in applications such as Keynote, I try to e-mail presentattion it doesnt work.

    I am a teacher and have my own iPad with a data plan.  We also have a router in teh classroom for wifi, and it has a very strong signal.  On Safari, the ipads can connect to the internet.  But when in applications such as Keynote and HTML Egg, I try to e-mail presentat. or post website to web, it doesnt work.  I tried re-setting the proxies and the router, no luck.  Please Help!  I am a teacher and want my students to be able to post their websites on to the web, and e-mail themselves and their parents their Keynote Presentations.

    Try this. Turn your iPad Off. Then disconnect the power going to the router for 30 seconds or longer. Then replug the power to the router (allow it to initialize) and turn On the iPad. Hopefully everything will connect. If not, see below.
    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • I've just installed CS6 creative suite mainly for photoshop CS6. It comes with camera raw 7.0.something, but need something newer to use my canon 6d. When I download camera raw 8.5 and install the raw converter doesnt work anymore, wont even open or isnt

    I've just installed CS6 creative suite mainly for photoshop CS6. It comes with camera raw 7.0.something, but need something newer to use my canon 6d. When I download camera raw 8.5 and install the raw converter doesnt work anymore, wont even open or isnt available anymore in the plugin list. Tried to reinstall everything for a few times, but nothing helps.

    When I search for updates the raw converter doesnt get update automaticly. Frustrating, is costing me the whole morning.

  • I am locked out of my computer (macbook air) I just got it back from the apple store and they reset it. I put in a new password, and now it doesnt let me log in anymore. Command R doesnt work, all i hear is a sound, but nothing happens.

    I just got it back from the apple store and they reset it (becuase it kept shutting down and not turning back on).
    I put in a new password because i needed to start over from factory settings, but now it doesnt let me log in anymore. (I don't know if this is because it doesnt accpet my password, or I forgot my password in less than 5 minutes, or because when i typed in my new password, i typed it in wrong twice)
    Command R doesnt work, all i hear is a sound, but nothing happens.

    What I don't understand is why it is rejecting a password I am creating.
    Perhaps the password you are creating is too short, or has characters that are not allowed, or is not secure enough because it is a word in a dictionary.
    FileVault may have standards for what it considers an acceptable password. If the password is part of the 128-bit encryption scheme, it might have to be 16 characters, for example. (Don't know if that is true, but it's a possibility.) Check your documentation for password requirements.

  • Scrolling and rightclicking with magic mouse doesnt  work anymore

    Suddenly scrolling and rightclicking with magic mouse doesnt work any more. Left clicking and cursor moving works normal. I have checked the system preferences for the mouse and find nothing strange or unchecked. Any ideas?

    Also tried the universal access thing. Doesnt work.

  • People Cannot Hear Me When I make Calls on iPhone 4, Bought a new iPhone 4, uploaded all of my own information from the backup, and it still doesnt work, help!

    I went in to apple, they couldnt figure it out, I am on AT&T so I was figuring on going into their store today and seeing if its something with the network, if not I am going back to apple, but this is literally a brand new phone i bought yesterday, not refurbished or anything, brand new, does anyone know why this isnt working? Everything else works fine, the mics both work, its just when I make calls or someone calls me the mic doesnt work.

    When you see the same issue on more than one hardware device, it means that the problem is likely to exist outside of the hardware.  Two things to investigate would be the software/firmware on the backup and issues with the cellular network.  It's probably safe to rule out the cellular network as well.
    First, make sure that you have imported copies of all the information (pictures, videos, documents) on the device.  Do this thorough itunes, and the applications (photographic and document processing) on your computer.  Perform a firmware update then restore the device as new.  If the problem persists, then you may actually have the worst luck and discovered two devices with an identical issue.
    Read each of the steps before initiating the DFU.
    !.  Connect the iPhone to any computer running a fully updated version of iTunes.
    2. Press and hold both "home" and "sleep/wake" buttons
    3. After eight seconds let go of only the sleep/wake button.
    4. Keep holding the home button until you see a popup mesage in iTunes.
    5. Read all all the popups, then use iTunes to update the iPhone's software.
    If the popup fails to show, repeat steps 2 through 4

  • My iphone 4 is stuck on the reboot logo, ive ried holding both home and power to shut it off snd then keep holding home to let you plug it into itunes but it doesnt work. what do i do?

    my iphone 4 is stuck on the reboot logo, ive ried holding both home and power to shut it off snd then keep holding home to let you plug it into itunes but it doesnt work. what do i do?

    Did you try rebooting the iPad? You will need to have some battery power for this.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This may be helpful
    iPhone, iPad or iPod touch: Not responding or does not turn on
    Frozen or unresponsive iPad - Apple
    iPad: Unable to update or restore

  • My GX630 doesnt work properly on Windows Vista 64 bit

    Hi,
      I have problem with my GX630, its doest work properly at W Vista 64 bit, exactly Sleep mode ... its imposible to awake my computer nd I have to turn it off and than on to wake it up ...
      those buttons Turbo nd Eco mode doesnt work.
      sometimes happen that i get blue error screen and reset but I dont know why ... it wrotes something with some .dll file ...
    some people told me that its error is caused by that thing that there are no drivers for 64 vista yet ...
    I would be pleased if someone could help me up to this topic or to my email (removed to protect user privacy) or ICQ (115-378-414)  thank to all of you Jabu

    "sometimes happen that i get blue error screen and reset but I dont know why ... it wrotes something with some .dll file ... "
    What is the BSOD error code? What .dll ? Write down the exact error.
    Do you OC your notebook?
    "some people told me that its error is caused by that thing that there are no drivers for 64 vista yet ... "
    Install Drivers from MSI web:
    http://global.msi.eu/index.php?func=downloaddetail&type=driver&maincat_no=135&prod_no=1513
    "those buttons Turbo nd Eco mode doesnt work."
    You need SCM: http://global.msi.eu/index.php?func=downloaddetail&type=utility&maincat_no=135&prod_no=1513
    But x64 bit is N/A.
    Why you use x64bit version anyway? Why not 32bit?

Maybe you are looking for

  • My iCal crashes every time I try to open it. How can I fix this?

    I'm running Lion, have a Window's partition and use the machine to play blizzard games and watch movies mostly. This just started over the weekend of December 8, 2012. Thanks for the help!

  • "Search Result Types" Error on page view

    When visiting "Search Result Types" under Site Collection Administration on a few of my site collections I get an error. This only happens on some of the site collections and I can't pin down why its occurring. I've tried disabling "SharePoint Server

  • Issues with payment run

    Hi All, I am facing with a issue with payment run FPY1. Some of the customers are refunded the amount which is not supposed to be refunded to them. When i check the Contract account level and document level, at both level there is no outgoing payment

  • What is the best way to transfer data from a PC to an iMac?

    What is the best way to transfer data from a PC to an iMac?

  • Comments are saved where??

    Hallo! Does anyone know where iWeb's blog comments are saved? In which file? I have got the following problem: I spent the last 6 weeks not at home but with my girlfriend who has an iBook. So while I can't use my PC notebook for iWeb I had the idea t