get the only the lines that the max column

Hello

This is my entry
2     x1     18/03/2003         59,4
2     x1     03/04/2003         55
2     x1     01/01/2002             51,65
33     y1     22/08/2005        44
61     z1     22/08/2005          55
61     z1     01/01/2008        55
64     z2     16/01/2004       44
64     z2     22/08/2005       44 

How can I do to get only the rows having the max data_iv, that is: 

2     x1     03/04/2003          55
33     y1     22/08/2005        44
61     z1     01/01/2008        55
64     z2     22/08/2005       44 
Thanks in advance for any help

You can use the analytical functions with a view online, for example

SELECT   *
FROM     (
            SELECT   col1
            ,        col2
            ,        col3
            ,        col4
            ,        RANK() OVER (PARTITION BY col1 ORDER BY col3 DESC) ranking
            FROM     table
         )
WHERE    ranking = 1

Tags: Database

Similar Questions

  • Get the max of a field in a query of County

    Hi, I work with the following SQL query:
    WITH ORDERED_QUERY AS
    (
    SELECT COUNT(SHRTRIT_SBGI_CODE) AS "COUNT OF I",
                SHRTRIT_SBGI_CODE AS "SBGI CODE",
                SHRTRIT_SBGI_DESC AS "INSTITUTION"
    FROM SHRTRIT
    WHERE (SHRTRIT_SBGI_CODE LIKE 'I%'
    GROUP BY SHRTRIT_SBGI_CODE,SHRTRIT_SBGI_DESC
    ORDER BY "COUNT OF I" DESC
    )
    SELECT "COUNT OF I","SBGI CODE","INSTITUTION" 
    FROM ORDERED_QUERY
    WHERE ROWNUM <= 20
    What follows is the table mark code to get a test table:
    create table SHRTRIT
    (
    SBGI_CODE     VARCHAR2(6)     NOT NULL
    SBGI_DESC     VARCHAR2(10)
    ACTIVITY_DATE     DATE
    )
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I08883,MING-CHUAN COLL,10/6/2007 1:47:01 PM)
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I08883,MING-CHUAN COLL,2/10/2009 3:00:14 AM)
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I08883,MING-CHUAN COLL,10/6/2007 12:11:56 PM)
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I08883,MING-CHUAN COLL,2/10/2009 3:00:15 AM)
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I07979,RIYADH TECHNICAL COLLEGE,9/11/2008 3:01:26 AM)
    /
    INSERT INTO SHRTRIT
    (SBGI_CODE,SBGI_DESC,ACTIVITY_DATE)
    VALUES
    (I07979,RIYADH TECHNICAL COLLEGE,7/6/2010 9:00:02 PM)
    /
    {CODE}
    
    What I'm trying to do is get the max ACTIVITY_DATE for the institution when it's listed. For example, the max ACTIVITY_DATE for MING-CHUAN COLL is 2/10/2009 3:00:15 AM. The desired output is one record for MING-CHUAN, with a count of 4, the SBGI code, the Institution Name, and the max activity date of 2/10/2009 3:00:15 AM. However, when I just insert MAX(SHRTRIT_ACTIVITY_DATE) as part of the in-line query, it doesn't work like you'd think. It makes separate records for each date, such that here, there would be one record for 2/10/2009 with a count of 2 and one record for 10/6/2007 with a count of 2 for MING-CHUAN. 
    
    It might actually work with this small amount of data, I don't know because I can't make a test table with these few records to find out. It certainly isn't working with the actual table. I know it has something to do with the aggregation, but I'm not quite sure how to get around this problem. I've tried some different things, but none of them have gotten the desired results.
    
    Any help that you might be able to provide would be greatly appreciated!
    
    Thanks so much,
    Michelle Craig
    Data Coordinator
    Admissions operations and transfer services
    Kent State University                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Not exactly what you're trying to do, but:

    SQL> SELECT  *
      2    FROM  SHRTRIT
      3  /
    
    SBGI_C SBGI_DESC                      ACTIVITY_DATE
    ------ ------------------------------ ----------------------
    I08883 MING-CHUAN COLL                10/06/2007 01:47:01 pm
    I08883 MING-CHUAN COLL                02/10/2009 03:00:14 am
    I08883 MING-CHUAN COLL                10/06/2007 12:11:56 pm
    I08883 MING-CHUAN COLL                02/10/2009 03:00:15 am
    I07979 RIYADH TECHNICAL COLLEGE       09/11/2008 03:01:26 am
    I07979 RIYADH TECHNICAL COLLEGE       07/06/2010 09:00:02 pm
    
    6 rows selected.
    
    SQL> WITH ORDERED_QUERY AS (
      2                         SELECT  COUNT(SBGI_CODE) AS "COUNT OF I",
      3                                 SBGI_CODE AS "SBGI CODE",
      4                                 SBGI_DESC AS "INSTITUTION",
      5                                 MAX(ACTIVITY_DATE) LAST_ACTIVITY_DATE
      6                           FROM  SHRTRIT
      7                           WHERE SBGI_CODE LIKE 'I%'
      8                           GROUP BY SBGI_CODE,SBGI_DESC
      9                           ORDER BY "COUNT OF I" DESC
     10                        )
     11  SELECT  "COUNT OF I",
     12          "SBGI CODE",
     13          "INSTITUTION",
     14          LAST_ACTIVITY_DATE
     15    FROM  ORDERED_QUERY
     16    WHERE ROWNUM <= 20
     17  /
    
    COUNT OF I SBGI C INSTITUTION                    LAST_ACTIVITY_DATE
    ---------- ------ ------------------------------ ----------------------
             4 I08883 MING-CHUAN COLL                02/10/2009 03:00:15 am
             2 I07979 RIYADH TECHNICAL COLLEGE       07/06/2010 09:00:02 pm
    
    SQL> 
    

    SY.

  • Get the Max values and average of the different cycles in the single channel

    Hello

    I'm trying to get the Max values and average of the single channel that has different cycles it contains. I tried to use commands such as Chnclasspeak3 and chnpeakfind, but they were not useful for me. What I need is the Max values and average of the different cycles numbers saved in the data channel.

    Exampld if the string contains 5 numbers of repetitive cycles, then we must find the maximum values and the average of these 5 cycles in the single channel. Attached reference data. This is the .raw file and I have the plugin for it to use in diadem 11.1.

    Kind regards

    X. Ignatius

    Hello, Ignatius,.

    Sorry, it took some time to provide a replacement based on the script for the function. Please take a look at the attached script. I changed the script to use my function if the tiara-version is less than 12. My script function is not as fast and more stable than the implementation of tiara, but for now, it does the job

    Andreas

  • How to get the Max value in Essbase

    Hello

    I have problem to get the max value of 3 years in Essbase.
    How can I get the max value of Dec 2009, Dec 2010, Dec 2011.
    Suppose the value of Dec 2009 = 1000, dec 2010 = 1500 and Dec 2011 = 2000
    I want to get the max value of these three value, how can I do this in the Essbase calculation Script.
    Any idea?


    Thank you.

    Kind regards

    Joni

    You did not specify if year and period are there separate dimensions, in any case as always a number of different possbilities and I don't have much time today to think about, but only one method can be to use @MAXRANGE

    DIFFICULTY (other members to set, 'Dec')

    'MemberToStoreAgainst' = @MAXRANGE("MemberToFindMaxRangeFor","2009:"2011");

    ENDFIX

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How can I get the max of a measurement value

    How can I get the max of a measurement value?

    http://forums.NI.com/T5/LabVIEW/how-can-I-return-the-maximum-value-from-a-voltage-sensor-over/m-p/30...

    I tried the while loop max-min-solution described in this link. But this using my myRio acceleration measurement no longer works. It seems to hang.

    I use the I2C Communication.

    The inner circle while loop is a bad construction.  It will be either executed once, if enter the Boolean value is True, or forever if the value is false.

    Put your records on the timed loop shift and eliminate inside while loop.  Then your code should work.

  • How to increase the limit the max column pivot in BIEE 11 G?

    Hi Experts,

    How to increase the limit the max column pivot in BIEE 11 G?

    When the number of columns exceeds 256 in pivot mode, it generates the error message as below:

    Exceeded the configured maximum number of allowed output prompts, sections, the rows or columns.
    Error details
    Error codes: IRVLJWTA:OI2DL65P
    Geographical area: saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool.socketrpcserver, saw.threads
    Publ. SQL: 13678 ~ vid1ptgt0v5ubh39gesnauuhl6

    For example:
    ----------------Day
    Country - 20120101 - 20120102-... 20121231
    China - 10000 - 20000-...

    Try increasing the lines Max Instanceconfig.xml

    Path:-Middleware\instances\instance1\bifoundation\OracleBIPresentationServices\instanceconfig. XML




    300
    1000
    500
    25
    30


    Try to add in the configuration file and restart the services.

    Mark as correct if it is useful.

    Thank you.

  • How to get the max of an element value selected iota AF Max.

    Hello community,

    Let me explain the scenario.

    We have a workbook of discoverer, who have several reports. These reports extract information from multiple views built specifically to retrieve information in several tables. So far, quite normal.

    Like any other report you can build these views, you can select the elements (columns) that you will use to create the report. Some of these elements (columns) are selected with the function MAX aggregate for this element; is that to say, instead of the profit of the item, and then click the SUM aggregation function, select the MAX aggregate function. With this option, we can get limit the number of search results.

    In our case, we have created a report that shows the items that we have in our stock, for each item, the report shows the sum of kilograms, the average price, its value (the sum of the average price x kilograms) for each element of the family, and we want the report to display for each item (remember that each element is a line in the report or folder) the largest number of transaction_id (of which there been selected using MAX aggregate function for the selected item), but a kind of transaction types.

    Let's see an example:

    Family | Product name | Sum of the kgs. | Units | Average price | Value of stock. Month | Year | Transaction ID | Type of transaction | Date of movement
    4420 | ALUMINA PS - M BB720 | 97.680,000 | KG | 44737 | 43.699,10 | 04. 10. 7740531 | Finalización Conjunto WIP | 16/12/2009
    4420 | ALUMINA PS - M BB720 | 47.760,000 | KG | 44737 | 21.366,39 | 04. 10. 8100110 | EXCESS | 31/03/2010
    4420 | ALUMINA PS - M BB720 | 97.680,000 | KG | 44737 | 43.699,10 | 04. 10. 8201603 | EXCESS | 30/04/2010

    Considerations:

    The value you see in the Transaction id is the maximum value that the field have; is that to say, each of the types of transactions, it shows the highest (last) transaction that id. looking at the example, the problem now is that we want to pocket the result a llitle little more. We want the report to show only from each product name or transaction id higher, either the date of circulation higher (as in the example above matches the transaction id 8201603 that have the highest movement 30/04/2010 - date).

    I stopped at that point because I don't see how to filter the data to get the result we want.

    Any suggestion or help would be appreciated, cause honestly, I don't see how.

    Thanks in advance.

    Luis.

    Hi Luis
    In order to get the last day of the month, given a year and month as strings, you will need to convert the strings to a date. Assuming you have a two-digit month and, presumably, a 2 digit, with the year 2000 year and more, then you need to start with a date and let's start with the first day of the month like this:

    To_date ('01' |: month: year, 'DDMMYY')

    You can use the ADD_MONTHS function to spend the month by one and then if you subtract 1 from that you will end up with the last day of the month.

    EndofMonth = ADD_MONTHS (TO_DATE ('01' |: month |: year, 'DDMMYY'), 1)-1

    You can also use the LAST_DAY function like this:

    EndofMonth = LAST_DAY (TO_DATE ('01' |: month |: year, 'DDMMYY'))

    Best wishes
    Michael

  • How to get the Max value with other columns data also.

    Suppose that a query is covered with the data as

    Time of ID
    01 07/12/2014
    02 07/05/2014
    03 16/07/2014
    04 07/07/2014

    I need to get the ID and time to time max.
    that is, should I get
    Time of ID
    03 16/07/2014

    To do this, I wrote a query that gives me necessary data. But I thought that's the best way?
    Is it an effective way to get this data?
    My query that returns the data required is:

    SELECT ID, MAX_DT FROM
    (
    Select 'DUMMY', ID, TIME1, MAX (TIME1) OVER (PARTITION 'DUMMY') AS MAX_DT FROM TAB1
    WHERE ID IN (BLAH BLAH)
    )
    WHERE MAX_DT = (EDT) 1

    Frank mentioned links


    WITH test_data (id, time) LIKE)

    SELECT 01, to_date('2014/07/12','yyyy-mm-dd') FROM dual

    UNION ALL

    SELECT 02, to_date('2014/07/16','yyyy-mm-dd') FROM dual

    UNION ALL

    SELECT 03, to_date('2014/07/16','yyyy-mm-dd') FROM dual

    UNION ALL

    SELECT 04, to_date('2014/07/07','yyyy-mm-dd') FROM dual

    )

    SELECT id, time

    go (select id,

    time,

    Max (Time) on latest_time (order by time lines between unbounded preceding and following unbounded)

    of test_data

    )

    where time = latest_time

    ID TIME
    3 16/07/2014
    2 16/07/2014

    Concerning

    Etbin

  • Stuck with trying to get the max of the table version number

    We have a custom table that contains information on the work packages installed.

    Whenever a package is updated, a new entry is added to the table, with an incremented version number.

    Some examples of data:
    GET sampledata
    WITH sampledata AS
         (SELECT 'TEST0003' NAME
               , '1.1' VERSION
               , 'Installed Work Packet TEST 111' description
               , '18-Jul-2003' install_date
            FROM DUAL
          UNION ALL
          SELECT 'TEST0003'
               , '1.2'
               , 'Installed Work Packet TEST 111'
               , '18-Aug-2003'
            FROM DUAL
          UNION ALL
          SELECT 'TEST0003'
               , '1.3'
               , 'Installed Work Packet TEST 111'
               , '18-Sep-2003'
            FROM DUAL
          UNION ALL
          SELECT 'THIS2003'
               , '2.1'
               , 'Something Else'
               , '01-Jul-2009'
            FROM DUAL
          UNION ALL
          SELECT 'THIS2003'
               , '2.2'
               , 'Something Else'
               , '10-Aug-2009'
            FROM DUAL
          UNION ALL
          SELECT 'THIS2003'
               , '2.3'
               , 'Something Else'
               , '15-Nov-2009'
            FROM DUAL)
    SELECT *
      FROM sampledata;
    I would like to know how to return only the most recent version of each package of the table, but I can't get out.

    For example, the sample data above, I would like to only include:
    NAME               VERSION                DESCRIPTION                            INSTALL_DATE
    ---------------------------------------------------------------------------------------------------
    TEST0003           1.3                    Installed Work Packet TEST 111         18-Sep-2003
    THIS2003           2.3                    Something Else                         15-Nov-2009
    I see she has to somehow select MAX (version) for each different "NAME", but can't get my head around the syntax. What I have to GROUP BY "NAME" and then select the MAX (VERSION) of that?

    Any advice much appreciated.

    Thank you

    Thanks for the sample date!
    Yet another version:

    SQL>WITH sampledata AS
      2       (
      3          SELECT 'TEST0003' NAME, '1.1' VERSION, 'Installed Work Packet TEST 111' description,
      4                 '18-Jul-2003' install_date
      5            FROM DUAL
      6          UNION ALL
      7          SELECT 'TEST0003', '1.2', 'Installed Work Packet TEST 111', '18-Aug-2003'
      8            FROM DUAL
      9          UNION ALL
     10          SELECT 'TEST0003', '1.3', 'Installed Work Packet TEST 111', '18-Sep-2003'
     11            FROM DUAL
     12          UNION ALL
     13          SELECT 'THIS2003', '2.1', 'Something Else', '01-Jul-2009'
     14            FROM DUAL
     15          UNION ALL
     16          SELECT 'THIS2003', '2.2', 'Something Else', '10-Aug-2009'
     17            FROM DUAL
     18          UNION ALL
     19          SELECT 'THIS2003', '2.3', 'Something Else', '15-Nov-2009'
     20            FROM DUAL)
     21  SELECT   NAME, MAX(VERSION), MAX(description)KEEP (DENSE_RANK FIRST ORDER BY VERSION) AS description,
     22           MAX(install_date)KEEP (DENSE_RANK FIRST ORDER BY VERSION) AS install_date
     23      FROM sampledata
     24  GROUP BY NAME;
    
    NAME     MAX DESCRIPTION                    INSTALL_DAT
    -------- --- ------------------------------ -----------
    TEST0003 1.3 Installed Work Packet TEST 111 18-Jul-2003
    THIS2003 2.3 Something Else                 01-Jul-2009
    

    URS

  • How to get the Max of elements of type datetime value

    Hi all
    I wanted to get the last value timestamp (DateTime data type) of the node list. I have the following xml. In this xml file, I want to get the modifydate element that has the last time stamp via xquery/xpath, it should return me following result 2011-09-29 T 17: 21:17 + 10:00

    < CustomerList >
    < CustomerDetails >
    < Name > Test 1 < / name >
    assets of < status > < / status >
    < modifyDate > 2011-08-20T 17: 21:17 + 10:00 < / modifyDate >
    < / CustomerDetails >

    < CustomerDetails >
    < Name > Test 2 < / name >
    Cancel < status > < / status >
    < modifyDate > 2011-08-29T 17: 21:17 + 10:00 < / modifyDate >
    < / CustomerDetails >

    < CustomerDetails >
    < Name > Test 3 < / name >
    assets of < status > < / status >
    < modifyDate > 2011-09-29T 17: 21:17 + 10:00 < / modifyDate >
    < / CustomerDetails >
    < / CustomerList >


    I tried to use the
    CustomerList/CustomerDetails/modifyDate [not (. < =... / the above - sibling:CustomerList/CustomerDetails modifyDate) and not (. < =... / following - sibling:CustomerList/CustomerDetails modifyDate)]
    But it does not work on the datetime data type.
    Any help in this regard is highly appreciated.

    Concerning

    Published by: user6736659 on Sep 5, 2011 06:15

    Hello

    The following XQuery query should give you what you want:

    max(
     for $i in /CustomerList/CustomerDetails/modifyDate
     return xs:dateTime($i)
    )
    

    For example, by using Oracle SQL:

    SQL> var xmldoc varchar2(4000)
    SQL> begin
      2   :xmldoc := '
      3  
      4   Test 1
      5  active
      6  2011-08-20T17:21:17+10:00
      7  
      8
      9  
     10   Test 2
     11  cancel
     12  2011-08-29T17:21:17+10:00
     13  
     14
     15  
     16   Test 3
     17  active
     18  2011-09-29T17:21:17+10:00
     19  
     20  ';
     21  end;
     22  /
    
    PL/SQL procedure successfully completed
    
    SQL> select xmlquery('max(
      2   for $i in /CustomerList/CustomerDetails/modifyDate
      3   return xs:dateTime($i)
      4  )'
      5  passing xmltype(:xmldoc)
      6  returning content
      7  )
      8  from dual
      9  ;
    
    XMLQUERY('MAX(FOR$IIN/CUSTOMER
    --------------------------------------------------------------------------------
     2011-09-29T17:21:17.000000+10:00
     
    
  • Get the max of this query

    DB version: 10 gr 2

    My query below is a union of two queries max. Currently, it returns two rows.
    select max(to_timestamp(to_char(END_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')) 
    from SHIP_DTL
    where SHIP_DTL.IS_ENABLED = 1 AND SHIP_DTL.IS_DELETED = 0 
    AND COMPANY_ID =1
    and cost_event_id=1 and END_EFFECTIVE_DATE is not null
    union
    select max(to_timestamp(to_char(START_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')) from SHIP_DTL
    where SHIP_DTL.IS_ENABLED = 1 AND SHIP_DTL.IS_DELETED = 0 AND COMPANY_ID =1
    and cost_event_id=1 and END_EFFECTIVE_DATE is null;
    
    MAX(TO_TIMESTAMP(TO_CHAR(END_EFFECTIVE_DATE,'YYYY-MM-DDHH24:MI:SS'),'YYYY-M
    ---------------------------------------------------------------------------
    09-12-01 05:39:00.000000000
    09-12-30 06:55:00.000000000
    I want to get the most out of these two lines. So, I tried the following query using double. But I get the error message
    SQL> select max (select max(to_timestamp(to_char(END_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-M
    M-DD HH24:MI:SS')) 
      2  from SHIP_DTL
      3  where SHIP_DTL.IS_ENABLED = 1 AND SHIP_DTL.IS_DELETED = 0 
      4  AND COMPANY_ID =1
      5  and cost_event_id=1 and END_EFFECTIVE_DATE is not null
      6  union
      7  select max(to_timestamp(to_char(START_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:
    MI:SS')) from SHIP_DTL
      8  where SHIP_DTL.IS_ENABLED = 1 AND SHIP_DTL.IS_DELETED = 0 AND COMPANY
    _ID =1
      9  and cost_event_id=1 and END_EFFECTIVE_DATE is null) from dual;
    select max (select max(to_timestamp(to_char(END_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD 
                *
    ERROR at line 1:
    ORA-00936: missing expression
    What I'm doing wrong here?
    select max(dt) from (
     SELECT MAX(to_timestamp(TO_CHAR(END_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')) dt
       FROM SHIP_DTL
      WHERE SHIP_DTL.IS_ENABLED = 1
    AND SHIP_DTL.IS_DELETED     = 0
    AND COMPANY_ID              =1
    AND cost_event_id           =1
    AND END_EFFECTIVE_DATE     IS NOT NULL
      UNION
    SELECT MAX(to_timestamp(TO_CHAR(START_EFFECTIVE_DATE,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS'))
       FROM SHIP_DTL
      WHERE SHIP_DTL.IS_ENABLED = 1
    AND SHIP_DTL.IS_DELETED     = 0
    AND COMPANY_ID              =1
    AND cost_event_id           =1
    AND END_EFFECTIVE_DATE     IS NULL
    )
    

    put in a sub query

    Ravi Kumar

  • How to get the max sequence number when some record exists in the database table

    Hello

    I need to create the sequence that he should leave value max already exists in the table.

    Example:
    I have a table as below:

    ID NAME
    1A
    1 a
    3 C
    4 D


    Now, during the creation of sequence it should start from 5 but I should ' t START WITH 5 hard-code in the sequence to create. Is it possible to do without Hardcoding the max value in the sequence. It automatically brings the value max + 1 for the next data when I insert.


    CREATE THE TEST_SEQ SEQUENCE. NEXTVAL
    START WITH [Max + 1 val of the table]
    MAXVALUE 9999999999999999999999999999
    MINVALUE 1
    NOCYCLE
    CACHE 20
    ALL;


    Thank you...

    Published by: 998976 on April 18, 2013 04:37

    Published by: 998976 on April 18, 2013 04:38

    Hello

    All the numbers in a CREATE SEQUENCE statement are literals; no other types of numeric expressions are allowed.
    You need dynamic SQL statements to do something like what you want. For example:

    COLUMN     seq_start_col     NEW_VALUE  seq_start
    
    SELECT     1 + MAX (val)     AS seq_start_col
    FROM     table_x;
    
    CCREATE SEQUENCE TEST_SEQ.NEXTVAL
    START WITH  &seq_start
    MAXVALUE 9999999999999999999999999999
    MINVALUE 1
    NOCYCLE
    CACHE 20
    NOORDER;
    
  • Get the max value with other areas

    Hi all

    I have a table as below

    Value name
    - - - - - - - - - - - - - - - -
    A1 5
    A3 10
    A2 7
    A2 9
    A1 10

    What I get is the max (Value) and with the consolidation of its name

    Value name
    - - - - - - - - -
    A2 16

    Thank you
    Alex

    Published by: user8606416 on June 1, 2011 10:17

    Published by: user8606416 on June 1, 2011 10:26

    Depends on how you feel on one of the links of:

    SELECT name, value
    FROM (SELECT name, SUM(value)
          FROM table
          GROUP BY name
          ORDER BY 2 DESC)
    WHERE rownum = 1
    
    SELECT name, SUM(value)
    FROM table
    GROUP BY name
    HAVING SUM(value) >= ALL (SELECT SUM(value)
                              FROM table
                              GROUP BY name)
    

    among many other methods. The first takes a single arbitrary registration in the case of a tie, and the second shows all the related records.

    John

  • Get the MAX value of dimension 2 table

    I have a little trouble to find a value MAX (or MIN) of the second dimension in a 2-dimensional array. I do a query and the first dimension is the column name, the second is the values. I'm coming out of the MAX value of the column in the second dimension. ArrayMax said "the array passed cannot contain more than one dimension."

    Any ideas? I'm sure that this is possible.

    MaxValue = ArrayMax (QueryName ["FieldName"]);

    or Q of Q.

  • How to get the required column, the names of tables for the preparation of the report.

    Based on the MD50 how to get the exact name, the table names he joined for report development. as I am new on this project and the purchase of failet for R12.
    How can I start my approach to prepare the data for the report model? How can I search the database based on the respective diagrams of means?
    all input appreciated

    Hello

    You can find information about schema objects in eTRM Web site, you can also consult the documentation for product/module and see if it helps. If you already have any report (standard or custom), you can enable the trace and run the program to see which object it access or open the report using Report Designer and see the code.

    ETRM Oracle
    http://ETRM.Oracle.com

    Oracle Applications documentation
    http://www.Oracle.com/technology/documentation/applications.html

    Kind regards
    Hussein

Maybe you are looking for

  • worm virus on chrome

    I have a virus worm on chrome. Can U help me to destroy it...

  • compatible memory Macbook Pro 2009

    Hi everyone I have a laptop macbook pro mid-2009 intel core 2 duo 2.53 GHZ. I'm hoping to buy a ' 8 GB Corsair PC3 - 10666 DDR3 - 1333 SODIMM RAM (2 x 4 GB) Memory Module Kit "someone knows it will work OK? ".

  • Screen of remote desktop: fonts and icons of the remote desktop window are so small

    I try to connect via Office server2012 windows remotely. The remote computer is a Server Terminal server where at least 240 users are connected. The fonts and icons of the remote desktop window are so small, all other users who are connected to the s

  • M9400f wont start

    I have a problem with my computer M9400f. It came with Vista, and I upgraded to Win 7 in the hope of solving the problem, but nothing helped. I searched on the net and HP support and any other source that remotely suggested a solution. The problem is

  • Microsoft Product key not accepted

    HP Mini 311-1037NR PC After the confirmation of my computer has Microsoft 7 [32 bit] installed, after confirming that my computer shows this program updated from today and my computer shows Microsoft t as "enabled" under computer/properties I am alwa