Max vs characteristic of 10g

I would like to have a folder with the lfdnr max. Does anyone know of a new feature - 10g instead of my statement?
SQL> with dummy as ( select 25 Nr#, 1  LfdNr, to_date('30.06.1982','dd.mm.yyyy') end_date from dual union all
  2                  select 25 Nr#, 2  LfdNr, to_date('30.06.1988','dd.mm.yyyy') end_date from dual union all
  3                  select 25 Nr#, 3  LfdNr, to_date('30.11.1997','dd.mm.yyyy') end_date from dual union all
  4                  select 25 Nr#, 4  LfdNr, to_date('31.12.2009','dd.mm.yyyy') end_date from dual union all
  5                  select 44 Nr#, 1  LfdNr, to_date('07.05.2002','dd.mm.yyyy') end_date from dual union all
  6                  select 44 Nr#, 2  LfdNr, to_date('01.08.2006','dd.mm.yyyy') end_date from dual union all
  7                  select 44 Nr#, 3  LfdNr, null end_date from dual union all
  8                  select 62 Nr#, 1  LfdNr, to_date('25.04.2006','dd.mm.yyyy') end_date from dual union all
  9                  select 62 Nr#, 2  LfdNr, to_date('11.07.2009','dd.mm.yyyy') end_date from dual union all
 10                  select 11 Nr#, 1  LfdNr, to_date('07.05.2002','dd.mm.yyyy') end_date from dual union all
 11                  select 11 Nr#, 2  LfdNr, to_date('01.08.2006','dd.mm.yyyy') end_date from dual union all
 12                  select 11 Nr#, 3  LfdNr, to_date('21.09.2007','dd.mm.yyyy') end_date from dual)
 13  select Nr#, LfdNr, end_date 
 14  from dummy
 15  where lfdnr IN (select max(lfdnr) from dummy
 16           group by nr#)
 17  and end_date >= sysdate 
 18  group by nr#, LfdNr, end_date
 19  /

       NR#      LFDNR END_DATE
---------- ---------- --------
        25          4 31.12.09
        62          2 11.07.09

SQL> 

Why would you use a 10g feature? No particular reason?

I think you can also write this:

select nr#
     , lfdnr
     , end_date
  from dummy
 where end_date >= sysdate
 group by nr#, lfdnr, end_date
having max (lfdnr) = lfdnr

Tags: Database

Similar Questions

  • What is characteristic of the programming on 10g which have been deprecated on 11g?

    Hi all

    I knew little about novelty and development on 11g, but I don't know about programming that have been deprecated or obsolete function on 11g.

    Because my client if they going to 11g, source codes he touched or had to be rewritten?

    Update: I opened SR for this issue already if I got all the information, I will share to you all as soon as POSSIBLE.

    Thanks in advance.

    Hiko

    Hi all

    Oracle support give me answer this question that 'all the features that are supported in 10g is also supported in 11g release so.".

    Thank you for your comments.

    Hiko

  • Max Number of columns allowed in Discoverer 9i / 10g report

    Hello

    I need to prepare a report of discoverer 9i which has 62 columns. Does anyone know how the Max number of columns is allowed in discoverer reports. I'll be able to include all of the 62 columns without any problem?

    Thanks advanced

    Lokesh.

    Hello
    Although I couldn't find any document about it, I don't think that you will have a problem with the discoverer.
    I don't know how the java it take good care.
    From the Viewer (and I hope I'm not mistaken and mislead you) in the definition of columns
    You can choose up to 999 columns to present so I guess that there will be no problem with 62.

  • The sound is too low on Satellite L650 - 10G

    My new L650 - 10G, running on Windows 7 64 bit, is disappointing. I can live with that, but what is a problem, is that the peak power is poor. In other words, the volume of the ridge is not strong enough. It's probably fixable, because I don't know that the speakers can produce at a higher level, even if they are not very good.

    I have the latest audio drivers. Any suggestions - outside the use of external speakers?
    Thank you.
    Andy

    > But even taking into account, of low quality speakers, sound production max is too low

    This is a typical problem for laptop speakers. Fortunately, my model is equipped with Harmon Kardon and the sound is impressive. For you, I would recommend to get the external speakers...

  • Complete equipment of simulation using LabView, Multisim, and MAX (easy answer accepted!)

    Hello, all!

    Sorry, I'm new, but I checked around for a definitive answer on this, but I'm not 100% sure.  I learn LabView for a physics of upper-division course.  We use hardware (DAQ - MX) and a mixture of laboratory equipment - mainly stuff such as voltmeters, oscilloscopes and test setup with simple components.  I also work with NIM instrumentation, but that's secondary to my needs here.  So, when I'm away from the school, is it possible to make a complete simulation of my classroom work using LabView, Multisim (for my model) and the measurement and Automation Explorer (for the acquisition of data-MX)?  I know I can create a circuit and drop it in Labview, but I'm not sure on the acquisition of data.  I hope for what is a "seamless" reconstruction of what I do in class.  I can't take a simple 'yes' or ""; as long as I know it's possible, I can find the solution.

    Thanks for the help!

    I wrote 'sim' screws in many situations where I need to work away from the hardware store.  I think that MAX has a few features, but you may be limited in the types of signals, you can simulate.

    For my sim screw, I make a copy of the original VI with ".sim" added file name.  I also change the icon in a characteristic way to identify the version of the sim card on the BD. In this way the two VI have the same connector pane and are interchangeable on the BD structure. disable the diagram can be your friend here. Inside of the VI of sim, I generate the signal in any form I want.  You can also add additional if necessary controls.

    Lynn

  • QRCode in Oracle Database 10g class

    Hi guys,.

    I am trying to install a java class that generates an Image QR in the server. The class is QRCode.class if I run this class in the server, then the QR Image is generated, now I want to do this, but the appeal of this java class in the database but I can't compile the java class into the database, the code for the class is:

    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED APPS. " QRCode"AS

    package prosegur.qrcode;

    to import java.awt.image.BufferedImage;

    import java.io.IOException;

    import java.util.ArrayList;

    import java.util.List;

    public class {QRCode

    private static final int PAD0 = 0xEC.

    private static final int PAD1 = 0x11;

    private int reference;

    Private Boolean [] [] modules;

    private int moduleCount;

    private int errorCorrectLevel;

    private list < QRData > qrDataList;

    public QRCode() {}

    this.typeNumber = 1;

    this.errorCorrectLevel = ErrorCorrectLevel.H;

    this.qrDataList = new ArrayList < QRData > (1);

    }

    public int getTypeNumber() {}

    return of reference;

    }

    {} public void setTypeNumber (int reference)

    this.typeNumber = reference;

    }

    public int getErrorCorrectLevel() {}

    Return errorCorrectLevel;

    }

    {} public void setErrorCorrectLevel (int errorCorrectLevel)

    this.errorCorrectLevel = errorCorrectLevel;

    }

    {} public void addData (string data)

    addData (data, QRUtil.getMode (data));

    }

    ' Public Sub addData (String, int mode data) {}

    {Switch (mode)}

    case Mode.MODE_NUMBER:

    addData (new QRNumber (data));

    break;

    case Mode.MODE_ALPHA_NUM:

    addData (new QRAlphaNum (data));

    break;

    case Mode.MODE_8BIT_BYTE:

    addData (new QR8BitByte (data));

    break;

    case Mode.MODE_KANJI:

    addData (new QRKanji (data));

    break;

    by default:

    throw new IllegalArgumentException ("mode:" + mode);

    }

    }

    public void clearData() {}

    qrDataList.clear ();

    }

    protected void addData (QRData qrData) {}

    qrDataList.add (qrData);

    }

    protected int getDataCount() {}

    Return qrDataList.size ();

    }

    protected QRData getData (int index) {}

    Return qrDataList.get (index);

    }

    {} public is Boolean (int row, int col)

    If (modules [row] [column]! = null) {}

    Return modules [row] [col] .booleanValue ();

    } else {}

    Returns false;

    }

    }

    public int getModuleCount() {}

    Return moduleCount;

    }

    public void make() {}

    make (false, getBestMaskPattern());

    }

    private int getBestMaskPattern() {}

    int minLostPoint = 0;

    model int = 0;

    for (int i = 0; i < 8; i ++) {}

    Make (true, i);

    int lostPoint = QRUtil.getLostPoint (this);

    If (i == 0 | minLostPoint > lostPoint) {}

    minLostPoint = lostPoint;

    model = i;

    }

    }

    return the template;

    }

    Private Sub (Boolean test, int maskPattern) {} do

    moduleCount = reference * 4 + 17;

    modules = new Boolean [moduleCount] [moduleCount];

    setupPositionProbePattern (0, 0);

    setupPositionProbePattern (moduleCount - 7, 0);

    setupPositionProbePattern (0, moduleCount - 7);

    setupPositionAdjustPattern();

    setupTimingPattern();

    setupTypeInfo (test, maskPattern);

    If (reference > = 7) {}

    setupTypeNumber (test);

    }

    DataArray [] QRData = qrDataList.toArray (new QRData [qrDataList.size ()]);

    data Byte [] = createData (reference, errorCorrectLevel, dataArray);

    mapData (data, maskPattern);

    }

    ' Private Sub mapData (data byte [], int maskPattern) {}

    int inc = - 1;

    int row = moduleCount - 1;

    int bitIndex = 7;

    int byteIndex = 0;

    for (int col = moduleCount - 1; col > 0; col = 2) {}

    If (col == 6) col -;

    While (true) {}

    for (int c = 0; c < 2; c ++) {}

    If (modules [row] [column - c] == null) {}

    darkness Boolean = false;

    If (byteIndex < data.length) {}

    Black = (((données [byteIndex] >>> bitIndex) & 1) == 1);

    }

    Boolean mask = QRUtil.getMask (maskPattern, line, col - c);

    If {(mask)

    Black =! Dark;

    }

    modules [row] [column - c] = Boolean.valueOf (dark);

    -bitIndex;

    If (bitIndex ==-1) {}

    byteIndex ++;

    bitIndex = 7;

    }

    }

    }

    rank += inc.;

    If (row < 0 | moduleCount < = row) {}

    rank-=, increase;

    Inc = - inc;

    break;

    }

    }

    }

    }

    private void setupPositionAdjustPattern() {}

    int [] pos = QRUtil.getPatternPosition (typeNumber);

    for (int i = 0; i < pos.length; i ++) {}

    for (int j = 0; j < pos.length; j ++) {}

    int row = pos [i];

    int col = pos [j];

    If (modules [row] [column]! = null) {}

    continue;

    }

    for (int r = - 2; r < = 2; r ++) {}

    for (int c = - 2; c < = 2; c ++) {}

    If (r ==-2 | r == 2 | c ==-2 | c == 2)

    || (r == 0 & & c == 0)) {

    modules [line + r] [col + c] = Boolean.valueOf (true);

    } else {}

    modules [line + r] [col + c] = Boolean.valueOf (false);

    }

    }

    }

    }

    }

    }

    ' private void setupPositionProbePattern (int row, int col) {}

    for (int r = - 1; r < = 7; r ++) {}

    for (int c = - 1; c < = 7; c ++) {}

    If (line + r < = - 1 | moduleCount < = row + r)

    || Col + c < = - 1. moduleCount < = col + c) {}

    continue;

    }

    If ((0 < = r & & r < = 6 & & (c == 0 || c == 6)))

    || (0 < = c & & c < = 6 & & (r == 0 | r == 6))

    || (2 < = r & & r < = 4 & & 2 < = c & & c < = 4)) {

    modules [line + r] [col + c] = Boolean.valueOf (true);

    } else {}

    modules [line + r] [col + c] = Boolean.valueOf (false);

    }

    }

    }

    }

    private void setupTimingPattern() {}

    for (int r = 8; r < moduleCount - 8; r ++) {}

    If (modules [r] [6]! = null) {}

    continue;

    }

    [r] modules [6] = Boolean.valueOf (r % 2 == 0);

    }

    for (int c = 8; c < moduleCount - 8; c ++) {}

    If (modules [6] [c]! = null) {}

    continue;

    }

    modules [6] [c] = Boolean.valueOf (c % 2 == 0);

    }

    }

    {} private void setupTypeNumber (Boolean test)

    int bit = QRUtil.getBCHTypeNumber (typeNumber);

    for (int i = 0; i < 18; i ++) {}

    Boolean mod = Boolean.valueOf (! test & & ((bits >> je) & 1) == 1);

    modules [I / 3] [I % 3 + moduleCount - 8-3] = mod;

    }

    for (int i = 0; i < 18; i ++) {}

    Boolean mod = Boolean.valueOf (! test & & ((bits >> je) & 1) == 1);

    modules [I % 3 + moduleCount - 8-3] [I / 3] = mod;

    }

    }

    ' Private Sub setupTypeInfo (Boolean test, int maskPattern) {}

    data = int (errorCorrectLevel < < 3) | maskPattern;

    int bit = QRUtil.getBCHTypeInfo (data);

    // ???

    for (int i = 0; i < 15; i ++) {}

    Boolean mod = Boolean.valueOf (! test & & ((bits >> je) & 1) == 1);

    If (I have 6 <) {}

    the [i] [8] modules = mod;

    } ElseIf (I < 8) {}

    modules [i + 1] [8] = mod;

    } else {}

    modules [moduleCount - 15 + i] [8] = mod;

    }

    }

    for (int i = 0; i < 15; i ++) {}

    Boolean mod = Boolean.valueOf (! test & & ((bits >> je) & 1) == 1);

    If (I < 8) {}

    modules [8] [moduleCount - i - 1] = mod;

    } ElseIf (I < 9) {}

    modules [8] [15 - i - 1 + 1] = mod;

    } else {}

    modules [8] [15 - i - 1] = mod;

    }

    }

    // ??

    modules [moduleCount - 8] [8] = Boolean.valueOf(!test);

    }

    public static ubyte [] createData (int errorCorrectLevel, int reference, dataArray [] QRData) {}

    RSBlock [] rsBlocks = RSBlock.getRSBlocks (reference, errorCorrectLevel);

    BitBuffer buffer = new BitBuffer();

    for (int i = 0; i < dataArray.length; i ++) {}

    Data QRData = dataArray [i];

    buffer.put (Data.getMode (), 4);

    buffer.put (Data.getLength (), data.getLengthInBits (typeNumber));

    Data.Write (buffer);

    }

    int totalDataCount = 0;

    for (int i = 0; i < rsBlocks.length; i ++) {}

    totalDataCount += rsBlocks [i] .getDataCount ();

    }

    If (buffer.getLengthInBits () > totalDataCount * 8) {}

    throw new IllegalArgumentException ("code length overflow. ("

    + buffer.getLengthInBits)

    + « > »

    + totalDataCount * 8

    + ")");

    }

    // ?????

    If (buffer.getLengthInBits () + 4 < = totalDataCount * 8) {}

    buffer.put (0, 4);

    }

    padding

    While (buffer.getLengthInBits (% 8)! = 0) {}

    buffer.put (false);

    }

    padding

    While (true) {}

    If (buffer.getLengthInBits () > = totalDataCount * 8) {}

    break;

    }

    buffer.put (PAD0, 8);

    If (buffer.getLengthInBits () > = totalDataCount * 8) {}

    break;

    }

    buffer.put (PAD1, 8);

    }

    Return createBytes (buffer, rsBlocks);

    }

    private static ubyte [] (BitBuffer buffer RSBlock [] rsBlocks) createBytes {}

    int offset = 0;

    int maxDcCount = 0;

    int maxEcCount = 0;

    int [] [] dcdata = new int [rsBlocks.length] [];

    int [] [] ecdata = new int [rsBlocks.length] [];

    for (int r = 0; r < rsBlocks.length; r ++) {}

    int dcCount is rsBlocks [r] .getDataCount ();.

    int ecCount = rsBlocks [r] .getTotalCount () - dcCount;

    maxDcCount = Math.max (maxDcCount, dcCount);

    maxEcCount = Math.max (maxEcCount, ecCount);

    [r] dcdata = new int [dcCount];

    for (int i = 0; i < dcdata [r] .length; i ++) {}

    dcdata [r] [i] = 0xff & buffer.getBuffer ([i + shift]);

    }

    offset += dcCount;

    Polynomial rsPoly = QRUtil.getErrorCorrectPolynomial (ecCount);

    Polynomial rawPoly = new polynomial (dcdata [r], rsPoly.getLength () - 1);

    Polynomial modPoly = rawPoly.mod (rsPoly);

    [r] ecdata = new int [rsPoly.getLength () - 1];

    for (int i = 0; i < ecdata [r] .length; i ++) {}

    int modIndex is i + modPoly.getLength () - ecdata [r] .length;.

    ecdata [r] [i] = (modIndex > = 0)? modPoly.get (modIndex): 0;

    }

    }

    int totalCodeCount = 0;

    for (int i = 0; i < rsBlocks.length; i ++) {}

    totalCodeCount += rsBlocks [i] .getTotalCount ();

    }

    data Byte [] = new ubyte [totalCodeCount];

    int index = 0;

    for (int i = 0; i < maxDcCount; i ++) {}

    for (int r = 0; r < rsBlocks.length; r ++) {}

    If (I < dcdata [r] .length) {}

    data [index ++] = dcdata (byte) [r] [i];

    }

    }

    }

    for (int i = 0; i < maxEcCount; i ++) {}

    for (int r = 0; r < rsBlocks.length; r ++) {}

    If (I < ecdata [r] .length) {}

    data [index ++] = ecdata (byte) [r] [i];

    }

    }

    }

    return data;

    }

    public static getMinimumQRCode (int errorCorrectLevel, string data) {} QRCode

    int mode = QRUtil.getMode (data);

    QRCode qr = new QRCode();

    qr.setErrorCorrectLevel (errorCorrectLevel);

    qr.addData (data, mode);

    int length = qr.getData (0) .getLength ();

    for (reference int = 1; Reference < = 10; reference ++) {}

    If (length < = QRUtil.getMaxLength (reference, errorCorrectLevel)) {}

    qr.setTypeNumber (typeNumber);

    break;

    }

    }

    QR.make ();

    return qr;

    }

    public BufferedImage createImage (int cellSize, int margin) throws IOException {}

    imageSize = getModuleCount() int * cellSize + margin * 2;

    BufferedImage image = new BufferedImage (imageSize imageSize, BufferedImage.TYPE_INT_RGB);

    for (int y = 0; y < imageSize; y ++) {}

    for (int x = 0; x < imageSize; x ++) {}

    If (margin < = x & & x < imageSize - margin)

    (& & margin < = y & & y < imageSize - margin) {}

    Col int = (x - margin) / cellSize;

    int row = (y - margin) / cellSize;

    If (is (row, col)) {}

    image.setRGB (x, y, 0x000000);

    } else {}

    image.setRGB (x, y, 0xffffff);

    }

    } else {}

    image.setRGB (x, y, 0xffffff);

    }

    }

    }

    return image;

    }

    }

    /

    And the error when I tried to compile is:

    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED APPS. " QRCode"AS

    *

    ERROR on line 1:

    ORA-29536: badly formed source: met "<" on line 13, column 22.

    Expected one of:

    < ID >...

    "[" ...

    "." ...

    "(" ...

    It's like the java compiler does not detect the line:

    private list < QRData > qrDataList;   With the symbols of <>...


    DB Version: Oracle Database 10 g Enterprise Edition Release 10.2.0.5.0 - 64bi


    Could someone help me? may may be the version of the java compiler of the database?


    Thank you!!


    Pablo. -.

    The version of the JVM in 10g does not include generic drugs

  • Get the date range min/max for consecutive events.

    Hi all...

    I am fairly new to the programming of the DB and is working on some examples I picked up a few places. The database version is 10g R2.

    I would like to configure the data here and I can explain my requirement.

    create table table_1
    (product_id varchar2(25),
    region_id  number,
    event_id number
    event_date date,
    event_status number(1))
    /
    
    
    

    Now the data because it is->

    insert into table_1 values ('Prod-1',10, null, to_date('01-feb-2014','dd-mon-yyyy'),null)
    /
    insert into table_1 values('Prod-1',10, 1001, to_date('10-mar-2014','dd-mon-yyyy'), 1)
    /
    insert into table_1 values('Prod-1',10, 1001, to_date('20-mar-2014','dd-mon-yyyy'), 3)
    /
    insert into table_1 values('Prod-1',10,1002, to_date('01-apr-2014','dd-mon-yyyy'), 1)
    /
    insert into table_1 values('Prod-1',10, 1002, to_date('10-apr-2014','dd-mon-yyyy'), 3)
    /
    commit
    /
    
    
    
    

    If the table now contains the following data

    select * from table_1; 
    
    
    

    PRODUCT_ID REGION_ID EVENT ID EVENT_DAT EVENT_STATUS

    ------------------------- ---------- -------- --------- ------------

    Prod-1 10 1 February 14

    Prod-1 10 1001 10 March 14 1

    Prod-1 10 1001 20 March 14 3

    Prod-1 10 1002 1 April 14 1

    Prod-1 10 1002 April 10, 14 3

    Now, the condition is as follows:

    Above is the dates start and end for the tests on a product in a given region. The event_status column indicates the dates of beginning and end. Event_status = 1, for the date of beginning and the event_status = 3 of the end date.

    A new event is now coming from March 21 and ending on March 31.

    The power required is a product identifier / region; If there are events that are ending and then count the days, for example, 1001 to end on March 20, but now the new event begins on 21 March... and the new event ends on 31 March and event 1002 begins 01 - Apr... and so on.

    The output required for this is as follows:

    PRODUCT_ID REGION_ID EVENT_MIN_DATE EVENT_MAX_DATE

    ------------------------- ---------- -------------- --------------

    Prod-1 10 10 14 March 10 April 14

    The output should give a product identifier / region, when events are immediately after the other, out the min date of beginning and end of max for all these manifestations of "back to back".

    Now I wrote the code for this, but it goes into a purely 'loop' for application in PLSQL... But my head tells me that if the results are correct. the PLSQL implementation is not the most efficient and effective way.

    Can someone help me to form the query? I tried to use functions analytical min/max but it gives me the start and end dates back even if my events are not "back to back" or previous/succeed each other... so my query result is not quite correct.

    Am reading on the TYPE clause but would be grateful if someone could help me with this query... or any other form better to implement this event so PLSQL can be used. The database version is 10g R2.

    Thank you

    K

    PS - The number of such events back to back is limited to 4 and the events could be created in any order. But if someone could help me with the scenario above; am sure I could make a request addressed to any change in the order. :-)

    No this isn't a recursive with clause, perhaps the UNION ALL you got confused. She will work with 10g.

    Since there are 2 tables that you said, the block all_data brings together only the lines of the two tables. table_1 start_date and end_date are built from the event_status (where the max in group by).

  • Ask about 10G of assistance card NETWORK Dell R415 to ESX 4.1 U1

    Hello

    We have a Dell server with the following specifications:

    Model - R415

    2 - CPU * AMD Opteron™ 4162EE, 6 c 1.7 GHz, 2 M 6 M/L2 L3, 1333 Mhz Max

    MEM

    Disc - 3 * 500GB 7.2 K RPM Near-Line SAS 3 .5in Cabled Hard Drive

    MEM (GB) - 64 (8 * 8GB)

    NIC - 2 on-Board 1 cards + 2 cards external network with model Intel X 520 - T2 double Port 10GBase-T copper Server Adapter

    In four network interfaces, two are currently up (connected to a switch) - one is a built-in NIC of 1 G and other is an external 10 G NIC

    I try to install ESX 4.1 Update 1 build on the above material. During the installation, I could see two embedded NIC 1 G to be detected in the network screen (one showing connected state and other disconnected). Then I advanced and installed the ESX Server.

    Installing ESX was to check if the 10G NETWORK adapter is supported by ESX 4.1 U1. Looks like that's not or we may have to load additional drivers, so that ESX to recognize the 10 G card.

    Can you please confirm whether this is a supported configuration / tested? The VMware HCL said Dell R415 is supported, but I could not find out whether the 10G card is supported

    Thanks, Vivek

    This map of 10GbE intel 82599? You may need to download and load the driver extra here or search list here (click on CD Driver)

  • Insert the value from the date of the operation, max

    Hello

    We use oracle 10g R2 on windows.

    I want to insert values from one table to the other. Suppose I have a table emp (empcode, salary, dt_update) and have another table emp_live (empcode, salary).

    data into the emp table are as
    EMPCODE     SALARY     DT_UPDATE
    
    281G     10611230.319     10/9/2010 6:38:30 PM
    281G     37819399.457     10/8/2010 6:38:30 PM
    291G     16500012.429     10/10/2010 6:38:30 PM
    291G     108145595.738     10/9/2010 6:38:30 PM
    292G     79449005.406     10/11/2010 6:38:30 PM
    292G     198819948.865     10/10/2010 6:38:30 PM
    293E     4532332.618     10/12/2010 6:38:30 PM
    293E     142572824.216     10/11/2010 6:38:30 PM
    294D     116505728.748     10/13/2010 6:38:30 PM
    294D     90087585.925     10/12/2010 6:38:30 PM
    My requirement is to insert only those records where the maximum date of DT_UPDATE.

    In the above senario only records below need to obtain insert
    EMPCODE     SALARY     DT_UPDATE
    281G     10611230.319     10/9/2010 6:38:30 PM
    291G     16500012.429     10/10/2010 6:38:30 PM
    292G     79449005.406     10/11/2010 6:38:30 PM
    293E     4532332.618     10/12/2010 6:38:30 PM
    294D     116505728.748     10/13/2010 6:38:30 PM
    I am trying to insert it as
    insert into emp_live select empcode,salary from emp where dt_update=(select max(dt_update) from emp)
    But above not giving not correct results beacase when I select the records as
    select empcode,max(dt_update) from emp group by empcode
    Above shows 1665 records, but when I am inserting only insert 16 records.

    Help, please.

    Something like this:

    create table test (empcode varchar2 (4), salary number, date of dt_update);
    Insert test values (' ' 281 G ", 10611230.319, to_date (October 9, 2010 06:38:30 ',' mm/dd/yyyy HH24:MI:SS));))
    Insert test values (' ' 281 G ", 37819399.457, to_date (October 8, 2010 06:38:30 ',' mm/dd/yyyy HH24:MI:SS));))
    Insert test values (' ' 291 G ", 16500012.429, to_date (October 10, 2010 06:38:30 ',' mm/dd/yyyy HH24:MI:SS));))
    Insert test values (' ' 291 G ", 108145595.738, to_date (October 9, 2010 06:38:30 ',' mm/dd/yyyy HH24:MI:SS));))
    Insert test values (' ' 292 G ", 79449005.406, to_date (October 11, 2010 06:38:30 ',' mm/dd/yyyy HH24:MI:SS));))
    Insert test values (' ' 292 G ", 198819948.865, to_date (October 10, 2010 06:38:30 ',' mm/dd/yyyy HH24:MI:SS));))
    insert into test values ('293E', 4532332.618, to_date (October 12, 2010 06:38:30 ',' mm/dd/yyyy HH24:MI:SS));))
    insert into test values ('293E', 142572824.216, to_date (October 11, 2010 06:38:30 ',' mm/dd/yyyy HH24:MI:SS));))
    Insert test values ('294, 116505728.748, to_date (October 13, 2010 06:38:30 ',' mm/dd/yyyy HH24:MI:SS));))
    Insert test values ('294, 90087585.925, to_date (October 12, 2010 06:38:30 ',' mm/dd/yyyy HH24:MI:SS));))

    SQL> column salary for 99999999999.9999;
    SQL> select * from test;
    
    EMPC            SALARY DT_UPDATE
    ---- ----------------- ---------
    281G     10611230.3190 09-OCT-10
    281G     37819399.4570 08-OCT-10
    291G     16500012.4290 10-OCT-10
    291G    108145595.7380 09-OCT-10
    292G     79449005.4060 11-OCT-10
    292G    198819948.8650 10-OCT-10
    293E      4532332.6180 12-OCT-10
    293E    142572824.2160 11-OCT-10
    294D    116505728.7480 13-OCT-10
    294D     90087585.9250 12-OCT-10
    
    10 rows selected.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  select min(empcode),max(salary),max(dt_update)
      2  from test
      3  group by empcode
      4* order by 1
    SQL> /
    
    MIN( MAX(SALARY) MAX(DT_UP
    ---- ----------- ---------
    281G  37819399.5 09-OCT-10
    291G   108145596 10-OCT-10
    292G   198819949 11-OCT-10
    293E   142572824 12-OCT-10
    294D   116505729 13-OCT-10
    
    SQL> insert into test
      2  (
      3  select min(empcode) empcode,max(salary) salary,max(dt_update) dt_update
      4  from test
      5  group by empcode
      6  )
      7  /
    
    5 rows created.
    
    SQL> select * from test;
    
    EMPC            SALARY DT_UPDATE
    ---- ----------------- ---------
    281G     10611230.3190 09-OCT-10
    281G     37819399.4570 08-OCT-10
    291G     16500012.4290 10-OCT-10
    291G    108145595.7380 09-OCT-10
    292G     79449005.4060 11-OCT-10
    292G    198819948.8650 10-OCT-10
    293E      4532332.6180 12-OCT-10
    293E    142572824.2160 11-OCT-10
    294D    116505728.7480 13-OCT-10
    294D     90087585.9250 12-OCT-10
    281G     37819399.4570 09-OCT-10
    
    EMPC            SALARY DT_UPDATE
    ---- ----------------- ---------
    293E    142572824.2160 12-OCT-10
    294D    116505728.7480 13-OCT-10
    291G    108145595.7380 10-OCT-10
    292G    198819948.8650 11-OCT-10
    
    15 rows selected.
    
    SQL>
    

    Concerning
    Girish Sharma

  • Forms 10g manufacturing full screen

    Hi all

    I want to make my full screen application-shaped 10g. I tried using relaxation SET_WINDOW_PROPERTY. But still, I couldn't do the full-screen window. How am I going to do this?

    Thanks in advance.
    NZK

    If you use separateFrame = true, then this will increase the separateFrame to size the display max. However, as mentioned in versions prior to 11, it won't really maximize it.

    Set_Window_Property(FORMS_MDI_WINDOW, WINDOW_STATE, MAXIMIZE);
    

    As mentioned, to increase container applet in the browser, set HEIGHT and WIDTH in formsweb.cfg to a size in pixels or as a percentage (100%).

  • the Max version data

    Hello

    need your help in obtaining data from max version and I have two 10g (10.2.0.4) and 11 GR 2

    DB version: 10g and 11 g 2

    Table:
    =========
     
    
    user_charachters 
    ========== 
    user_id number 
    u_version number 
    charachters number 
    
    
    user_id and u_version has indexes and table has about million rows and  growing 
    examples of data
    ===========
     
    
    user_id version characters 
    2345 1 25 
    2345 2 30 
    456789 1 78 
    33333 1 45 
    33333 2 67 
    33333 3 23 
    I'm trying to get the characters in the max version of each user.here is the output example
     
    
    
    user_id version characters 
    2345 2 30 
    456789 1 78 
    33333 3 23 
    I have the following query and its taking forever, I was wondering is there a different approach / idea I should try
     
    
    
    select a.*                                                 
    from    user_charachters a                                    
    where      a.user_id || a.version = (select b.user_id|| max(b.version)    
                                             from   user_charachters b   
                                             where  b.user_id = a.user_id 
                                             group by b.user_id); 
    Please notify

    Published by: nydba on August 1, 2011 10:57
    with user_characters as (
                             select 2345 user_id,1 version,25 characters from dual union all
                             select 2345,2,30 from dual union all
                             select 456789,1,78 from dual union all
                             select 33333,1,45 from dual union all
                             select 33333,2,67 from dual union all
                             select 33333,3,23 from dual
                            )
    -- end of on-the-fly data sample
    select  user_id,
            max(version) version,
            max(characters) keep(dense_rank last order by version) characters
      from  user_characters
      group by user_id
    /
    
       USER_ID    VERSION CHARACTERS
    ---------- ---------- ----------
          2345          2         30
         33333          3         23
        456789          1         78
    
    SQL> 
    

    SY.

  • How to make the transition to digital in 10g

    Hi all


    We have 10g database of primary and standby, I have never worked before sleep, customer wants me start switch, can you please let me know how to make the transition to digital in 10g.


    Thank you very much.

    It's the way I'm following passage in the
    ------------------------------------------------------------

    (1) check that there is no active users connected to databases.
    (2) select message from v$ dataguard_status;
    (3) select protection_mode from database v$.

    Step 1 check if it is possible to perform a failover.

    SQL > select database_role, db_unique_name, SWITCHOVER_STATUS, v database name $;

    DATABASE_ROLE DB_UNIQUE_NAME SWITCHOVER_STATUS NAME
    ---------------- ------------------------------ -------------------- ---------
    PRIMARY OFMSREGT_SIM UNAUTHORIZED OFMSREGT

    SQL >

    If you get NO allow status for SWITCHOVER_STATUS, verify that the standby database is connectivity.

    If the SWITCHOVER_STATUS column displays ACTIVE SESSIONS, you can successfully achieve a failover by adding the WITH clause LOGOFF to the statement ALTER DATABASE COMMETTRE through PHYSICAL standby

    Step 2 open the passage on the primary database.

    SQL > SHUTDOWN IMMEDIATE;
    SQL > STARTUP MOUNT;
    SQL > ALTER DATABASE COMMIT TO SWITCH STANDBY MODE PHYSICAL;

    Step 4, check the transition state in the view V$ DATABASE.

    SQL > SELECT SWITCHOVER_STATUS FROM V$ DATABASE;
    SWITCHOVER_STATUS
    -----------------
    TO_PRIMARY
    1 selected line

    Step 5 place yourself in the role of physical standby database target the main role.

    You can switch a standby database physical role ensures the primary role
    When the standby database instance is mounted mode redo apply or open
    for read-only access

    SQL > ALTER DATABASE COMMIT AT THE GRADE CROSSING;

    Step 6 complete the transition of the database ensures the main role.

    If the physical standby database has not been opened in read-only mode since the
    the last time it was started, run the SQL ALTER DATABASE OPEN to open
    the new primary database:

    SQL > ALTER DATABASE OPEN;

    If the physical database was opened read only since the last
    time it was launched, you must close the database waiting for target and restart:

    SQL > SHUTDOWN IMMEDIATE;
    SQL > STARTUP;

    Note: There is no need to close and restart other bases before (not involved in the digital switchover) who are online at the time of the failover. These databases on hold will continue to
    function normally once the failover is completed.

    Step 7 if necessary, restart log apply services on standby databases.
    He must deliver the command FRO repeat apply as:
    SQL > change database recovery managed standby database disconnect from the session.
    or
    And stop repeating applies to give
    SQL > alter database recover managed standby database cancel;

    Step 3 Shut down and restart the former primary instance.

    SQL > SELECT OPEN_MODE FROM V$ DATABASE;

    Step 9 check the synchronization between the primary and standby:

    Primary
    SQL > select thread #, max(sequence#) in v$ archived_log where archived = 'YES' group by thread #;

    Sleep mode
    SQL > select thread #, max(sequence#) in v$ archived_log in case of application = 'YES' group by thread #;

    Stop the former primary instance and restart and mount the database:

    Sense of SWITCHOVER_STATUS
    --------------------------------------------
    The column SWITCHOVER_STATUS of v$ database can have the following values:

    NOT ALLOWED - this is a database of pending and the primary database has
    not been first switched, or it's a back-end database and there is no data pending.

    ACTIVE SESSIONS - indicates that there are active sessions of SQL attached to
    the primary database or emergency that must be disconnected before the
    failover operation is allowed.

    Transition to THE PENDING - this is a database of relief and the primary database
    application of the digital switchover has been received but untreated.

    LATENT pass - the digital switchover has been waiting mode, but has not completed
    and I went back to the primary database.

    Primary SCHOOL - this is a database of pending, any sessions active, i.e.
    allows to switch to a primary database.

    In STANDBY mode - this is a primary database, any sessions active, i.e.
    allows to switch to a standby database.

    RECOVERY NEEDED - this is a database of pending that has not received the
    application of the digital switchover.

  • PGA memory max

    Hello
    On 10G R2,.
    I have the error ORA-04030. Then I ask to see:

    Is there a set of limits of oracle?
    SQL> select
                    sum(value)/1024/1024 Mb
                 from
                     v$sesstat s, v$statname n
                  where
                      n.STATISTIC# = s.STATISTIC# and
                      name = 'session pga memory';  
    
            MB
    ----------
    113.337173
    And the process that requires too much memory?
    SQL> select
       sid,name,value
    from
       v$statname n,v$sesstat s
    where
       n.STATISTIC# = s.STATISTIC# and
       name like 'session%memory%' and SID=158   ;
    
           SID NAME                                VALUE
    ---------- ------------------------------ ----------
           158 session uga memory               88448200
           158 session uga memory max           89407000
           158 session pga memory               90528016
           158 session pga memory max          116497328
    Will deal with SID = 158 generate an ORA-04030 error because it consumes 116497328 bytes of memory that is larger than 113.337173 M found above?

    Thank you.

    PS: the queries come from 233869.1 note metalink.

    Hello

    This ORA-04030 can be caused by a lack of RAM on an environment (no shared server) dedicated, a too small PGA.

    Thank you.

  • Max aggregate

    For Oracle 10g.
    In addition to the following, how would I go about recovering the amount of the max (giftdate) and the date of the max (giftamt) in the form of columns? Follow these steps and everything must be separated from subqueries?

    SELECT id, MAX (giftdate) AS last_gift_date,
    MAX (giftamt) AS largest_gift_amount
    FROM donations
    GROUP BY id
    SELECT  id,
            MAX(giftdate) AS last_gift_date,
            MAX(giftamt) AS largest_gift_amount,
            MAX(giftdate) KEEP(DENSE_RANK LAST ORDER BY giftamt) AS largest_gift_amount_date,
            MAX(giftamt) KEEP(DENSE_RANK LAST ORDER BY giftdate) AS last_gift_date_amount
      FROM  gifts
      GROUP BY id
    /
    

    SY.

  • Min and Max of the sequence number

    Hello

    I have a table called pins (lot number 4,
    Sequence number (8)
    );

    I have data in the table:
    batch sequence
    386 100
    386 101
    386 102
    386 800
    386 801
    1 387
    2 387

    I want to know by draw the low values and high for sequence number, is the result, I am looking

    batch min (sequence), max (sequence)
    386 100 102
    386 800 801
    387 1 2

    Oracle 10g rel2

    Thank you

    Hello

    You want something like this:

    WITH       got_grp     AS
    (
         SELECT     lot
         ,     seq_num          -- SEQUENCE is not a good column name
         ,     seq_num - ROW_NUMBER () OVER ( PARTITION BY  lot
                                                      ORDER BY      seq_num
                                          ) AS grp
         FROM    pins
    --     WHERE     ...     -- any filtering goes here
    )
    SELECT       lot
    ,       MIN (seq_num)          AS min_seq_num
    ,       MAX (seq_num)          AS max_seq_num
    FROM       got_grp
    GROUP BY  lot
    ,            grp
    ORDER BY  lot
    ,            min_seq_num
    ;
    

    If I understand the probem, you want to GROUP BY, but many does not define groups by itself: each contiguous set of seq_nums in a batch is a separate group. In each of these groups, the difference between seq_num and a meter which reflects the order of seq_num generated in the query (using ROW_NUMBER) will be constant.

    This assumes that seq_num is an integer, and this (lot, seq_num) is unique.
    If this is not the case, the above query will have a small adjustment.

    If you want to display the INSERT statements for your sample data, then I could test this.

Maybe you are looking for