How to get only new rows

hello,
I have a table like below
id_emp (int)
id_est (int)
dt_est(date)
for each id_emp I can have multiple id_est with multiple dt_est... like below
id_emp id_est dt_est
1 1 2009-01-10
1 2 2009-01-13
2 3 2009-01-10
2 4 2009-01-12
2 5 2009-01-14
3 6 2009-01-12
4 7 2009-01-15
5 8 2009-01-17
5 9 2009-01-19
I would like to get just the new rows based on date for each id_emp, so my result should be like below
id_emp id_est dt_est
1 2 2009-01-13
2 5 2009-01-14
3 6 2009-01-12
4 7 2009-01-15
5 9 2009-01-19
How could I do that?
Thanks

Hi,
Try this one :
SELECT id_emp,
       max(id_est) keep (dense_rank last order by dt_est) id_est,
       max(dt_est) dt_est
FROM <your_table_here>
GROUP BY id_emp;

Similar Messages

  • How to get Only 20 rows? (Urgent)

    Hi, everyone.
    If I want to get only 20 words from a table,
    how can I write query?
    For example,
    Table name: WORD (this table is like dictionary)
    columns: W_WORD, W_MEANING
    Select * FROM WORD
    WHERE W_WORD LIKE 'H%'
    ORDER BY W_WORD ASC
    This query gets all the words starting with 'H'.
    But, I want to get only 20 results(rows).
    How can I do? I'm using MS Acess.
    Please response me. Thank you.

    You seem to be using SQLserver.
    SELECT TOP 20 *
    FROM WORD
    WHERE W_WORD LIKE 'H%'
    ORDER BY W_WORD ASC
    Look up the TOP clause in the docs for further info, other DBMS may have different syntaxes for this functionality

  • How to get only matching rows in Full Outer Join

    HI All,
    I was recently asked this question.
    How to fetch only matching data from two tables using Full Outer Join. Now, I understand that this is not the objective of using Full Joins but I was wondering whether this is possible or not.
    Any help in this regard will be highly appreciated.

    Full outer join returns both matching and not matching rows, if you want only matching rows why you don't use INNER JOIN?
    The following query does an INNER JOIN using a FULL JOIN which I think it doesn't make any sense.
    SELECT *
    FROM
    A FULL OUTER JOIN B
    ON A.ColumnName = B.ColumnName
    WHERE
    A.ColumnName IS NOT NULL
    AND B.ColumnName IS NOT NULL
    EntityLite: A Lightweight, Database First, Micro ORM

  • In Table Control How to get only a single row .

    Hi
    In Table Control How to get only a single row .I am able to decrease it its height to 4 but then 2 rows is getting dsplayed .I want only one row to be display and 2nd row should be deactivated or not visible.
    regards
    Avik
    Edited by: Julius Bussche on Jan 30, 2009 1:10 PM
    Removed friendly greeting from the subject title

    Hi Avik
    use this code it will help you.
    MODULE passdata OUTPUT.
      READ TABLE it_revision INTO wa_rev INDEX tab_clc-current_line.
      IF sy-subrc = 0.
        LOOP AT SCREEN.
          IF screen-group1 = '111'.      " 111 IS THE GROUP NAME
            screen-input = 1.          " input mode
            screen-active = 1.         " input mode.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 = '111'.       "GROUP NAME
            screen-input = 0.           " display mode
            screen-active = 1.          " DISPLAY MODE.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDMODULE.                 " PASSDATA  OUTPUT
    Make sure in group tou are passing the field name that you want in input mode on the base of other field
    Hope it will help you.
    Thanks
    Arun Kayal.

  • HT4061 I have changed my Apple Id but on my phone in i cloud only old ID is being shown . How to get my new ID on i cloud.

    Hi,
    I have changed my Apple ID & chasnged it on Icloud in my PC but on my phone in i cloud only old ID is being shown . How to get my new ID on i cloud.
    Shall be highly obliged if i could do the same on my phone ALSO.
    Thanks
    SCw

    Delete the existing iCloud account on your phone, then setup a new iCloud account with your new Apple ID. Also, Settings>Store...tap the ID shown...sign out...now sign back in with your new ID.  You will see Delete Account on you phone under iCloud Account. 

  • How to get number of rows return in SELECT query

    i'm very new in java, i have a question:
    - How to get number of rows return in SELECT query?
    (i use SQL Server 2000 Driver for JDBC and everything are done, i only want to know problems above)
    Thanks.

    make the result set scroll insensitve, do rs.last(), get the row num, and call rs.beforeFirst(), then you can process the result set like you currently do.
             String sql = "select * from testing";
             PreparedStatement ps =
              con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
             ResultSet rs = ps.executeQuery();
             rs.last();
             System.out.println("Row count = " + rs.getRow());
             rs.beforeFirst();~Tim
    NOTE: Ugly, but does the trick.

  • How to create a new row for a VO based on values from another VO?

    Hi, experts.
    in jdev 11.1.2.3,
    How to create a new row for VO1 based on values from another VO2 in the same page?
    and in my use case it's preferable to do this from the UI rather than from business logic layer(EO).
    Also I have read Frank Nimphius' following blog,but in his example the source VO and the destination VO are the same.
    How-to declaratively create new table rows based on existing row content (20-NOV-2008)
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
    I have tried:
    1.VO1(id,amount,remark1) and VO2(id,amount,remark2) are based on different EO,but render in same page,
    2.Drag and drop a Createwithparams button for VO1(id,amount,remark),
    3.add: Create insertinside Createwithparams->Nameddata(amount),
    4.set NDName:amount, NDValue:#{bindings.VO2.children.Amount}, NDtype:oracle.jbo.domain.Number.
    On running,when press button Createwithparams, cannot create a new row for VO1, and get error msg:
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: For input string: "Amount"
    java.lang.NumberFormatException: For input string: "Amount"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    Can anyone give some suggestions?
    Thanks in advance.
    bao
    Edited by: user6715237 on 2013-4-19 下午9:29

    Hi,CM,
    I'm really very appreciated for your quick reply! You know, today is Saturday, it's not a day for everyone at work.
    My principal requirement is as follows:
    1.select/check some rows from VO2, and for each selection create a new row with some attributes from VO2 as default values for VO1's corresponding attributes, and during this process the user may be cancel/uncheck or redo some of the selections.
    --so it's better to implement it in UI rather than in EO.
    2.it's better to implement this function with declarative way as in Frank Nimphius' blog.
    --little Jave/JS coding, the better. I only have experience in ORACLE FORMS, little experience in JAVA/JS.
    In order to get full information for the requirements of my use case, can take a check at:
    How to set default value for a VO query bind variable in a jspx page?
    (the end half of the thread: I have a more realworld requirement similar to the above requirement is:
    Manage bank transactions for clients. and give invoices to clients according to their transaction records. One invoice can contain one or many transactions records. and one transaction records can be split into many invoices.
    Regards
    bao
    Edited by: user6715237 on 2013-4-19 下午11:18
    JAVE->JAVA

  • How to get a unique row in a value set

    How to get a unique row in a value set which is used in concurrent program.
    Example if a table contains 10 unique rows i need only one row to show.
    Thanks

    add conditions in where clause to supress the duplicate values.
    On how to supress the duplicate values follow the link
    http://oracleschools.com/index.php?topic=40.msg76#msg76
    Thanks
    Prudhvi
    www.erpschools.com

  • How to get only current exception message from tables

    Hi
    In my sceanario , I want to have the list of Current MRP exception messages list from table
    I understand that MRP detailed lists, including all exception messages, are stored in transparent table MDKP and cluster table MDTC.
    I can tell ABAPer to write a report for me , to read the data from these tables , but I guess these tables contain old exception message also , which are not currently appearing in MRP list
    How to get only current exception message
    Rgds,
    sandeep

    Sandeep,
    MDTC contains only data from the most recent MRP run.  So, all messages you see are those which are currently valid.
    The messages might have first appeared during a previous run, but they still need to be addressed.
    Before you invest a lot of time and effort into writing and debugging a custom report, you should probably try to use the standard SAP functionality found in MD06.  On the Processing indicator tab, you can select "Only with new exceptions".  Here you can tag a material/plant as 'processed', and thereafter, the exceptions that existed there before you tagged the part will not be re-displayed.
    Best Regards,
    DB49

  • How to get the new dependency SCA's related to  7.4 version with out upgrading NWDI server

    Hi
    We are in process of upgrading the custom webdynpro and portal components to SAP Portal  7.4.
    I saw in some discussions that, we don't need to upgrade NWDI , we need to install new JDK version(1.6) to map that jdk to the new track for migrating the custom component to new track.
    But i have questions related to NWDI track dependency files.
    When i create new track to support 7.4 components need to be available in the respective track.
    we have central SLD and we create all the product and custom software components in that SLD(7.01) itself , To create the custom software component in SLD , i add  required dependency files. once the software component is ready, when i create the track  in nwdi system i will be able to fetch the custom software component in nwdi system by click on cms update.
    But now i  need following new new dependency software component versions   in SLD  related to  7.4 for creating new software component to those dependency's to support the new track in NWDI.
    EP_BUILDT
    SAP-JEE
    SAP_BUILDT
    SAP_JTECHS
    But my SLD server version is : 7.01 version.
    so do i need to upgrade the SLD server to  7.4 get the latest dependent SCA's  or just need import new SLD content in SLD server to add new custom software component to create?
    kindly advice how to get the new software components  in SLD without upgrading the NWDI  & SLD system to  7.4
    Thanks

    Jun,
    Thanks for the reply.
    But i am not able to find the  following two SCA's related to 7.4 version. I am able to find the rest of the SCA's. I able to see only 7.02 version related to following dependency files.
    SAP-JEE
    SAP_JTECHS
    SAP-EU (CA EU)  ( having only 7.01, 7.02, 7.10, 7.11 and 7.20) related to Guided procedures.
    Did they changed any naming conventions related to these software components? if so what are new software compnents names to use
    Please clarify.
    Thanks
    Vijay

  • Get only the rows where there are no matches in the tables

    To include in the results of a join with no matching rows, you can use a full outer join. In MS SQL Server provides the FULL OUTER JOIN operator, which allows you to include all rows from both tables, regardless of the presence or absence of values.
    You can add a WHERE clause in a FULL OUTER JOIN to get only the rows where there are no matches in the tables. The following query returns only those products for which there are no matches in the sales order.
    SELECT p1.Name, p2.SalesOrderID
    FROM  TAB1 p1
    FULL OUTER JOIN TAB2 p2
    ON p1.ProductID = p2.ProductID
    WHERE p1.ProductID IS NULL
    ORDER BY p.Name ;
    FULL OUTER JOIN is not supported in ABAP.  How can you solve this?
    Thanks in advance,
    Serena

    Similar problems can often be solved by using subqueries, please have a look here and try applying it.
    http://help.sap.com/abapdocu_702/en/abenwhere_logexp_subquery.htm
    Thomas

  • How to get my new in-car entertainment system to recognise my old 20g iPod by usb connection

    how to get my new in-car entertainment system to recognise my old 20g ipod by usb

    Hi albri51!
    I have an article for you that can help you with that question. The article is about troubleshooting car stereo connections, and can be found right here:
    iOS: Troubleshooting car stereo connections
    http://support.apple.com/kb/TS3581
    Hope this helps. Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • I need a code for verifiing my emailadress. How do get a new one ?

    Photoshop Elements 12
    Share
    Try to send email directly from Photoshop elements
    The program ask for a code to verifiing my emailadress
    I need a code for verifiing my emailadress. How do get a new one ?

    Check your email.  The screen capture says that they sent one to the email address listed.

  • How to insert a new row in the middle of an set of rows

    Hi
    How to insert a new  row in the middle of an set of rows ? and How to Reset the line id after the new row added ?
    Regards,
    Sudhir B.

    Hai,
    just try this,
    Instead of using omatrix.Addrow(1,-1) use like
    omatrix.AddRow( RowCount , Position)
    RowCount
    The number of rows to add (default is 1)
    Position
    The position of the new rows (0-based; default is -1, meaning append row to the end)
    After adding rows in matrix For, sno.
    for i=1 to omatrix.visualrowcount
    otext=omatrix.getcellspecific("columnid",i)  '--where columnid is the unique id of the sno column
    otext.value=i
    next i
    Hope this helps you.
    Thanks & Regards,
    Parvatha Solai.N

  • How to get count of rows for a table?

    Hi,
    How to get count of rows for a table and secondly, how can i have access to a particular cell in a table?
    Regards,
    Devashish

    Hi Devashish,
    WdContext.node<Your_node_name>().size() will give you the no: of rows.
    This should be the node that is bound to the table's datasource property.
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value); will select the row at that particular index.
    You can access an attribute of a particular row as
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value).get<attribute_name>();
    Hope this helps,
    Best Regards,
    Nibu.
    Message was edited by: Nibu Wilson

Maybe you are looking for

  • TMS Setup - One package to two seperate landscapes

    My customer has one development instance that services two test and production landscapes for seperate geographical regions. This is a new installation and they are developing using packages. They currently belive that they can transport the objects

  • Which port on my MacBook Air ?

    Hi everyone, i wanted to know what kind of port i have on my 2008 MacBook Air to plug it to my TV. Thanks for your answer. Theo

  • How to load sets from R3 to BW

    In R3, we have many report painter reports which were written using various account sets and cost center sets, etc.   These sets were created in t-code GS01, and they can contain one single node or multiple nodes.   We are activating various BW cubes

  • Artist in compilations changed itself to 'Various'

    Hi When I originally loaded compilations onto my Pc, the artist was listed as 'Various' and the song title was listed in the format 'artist/song'. I went through all of these albums and cut+pasted the artist into the artist column so they were listed

  • JLabel LAF in J2SDK1.4.1

    Hello. With the precedents JVM, the JLabels of my application were blue. Now with the 1.4.1 they appear black. I suppose there are modifications in default LAF. Does any of you know how I can do to keep the previous appearance ? Thanks in advance