Select wich returns the shortest time

Hi,
I don't know how to do a select. I'm goig to explain what I want to get to see wheter somebody can help.
I've a select that returns the following columns (table t):
handle_id, logon_id, object_name
I've another table with the following columns (table t0):
time0, handle_id, logon_id, object_name, source, eventid
If I do this select:
select t0.time0, t0.source, t0.eventid
from t, t0
where t.handle_id = t0.handle_id and t.logon_id = t0.logon_id and t.object_name = t0.object_name
It returns me several records with the same condition (handle_id, logon_id, object_name) because, obviously, I've repeated recors with the same conditions but with diferent time0.
I would like to get only one record for each condtion with the shortest time0.
How can I do it?
I've tried with distinct but it isn't what I want.
Thanks in advance.
Regards.

select  *
  from  (
         select  t0.time0, t0.source, t0.eventid........ , t0.accesses,
                 row_number() over(partition by t0.handle_id,t0.logon_id,t0.object_name order by t0.time0) rn
           from  t,
                 t0
           where t.handle_id = t0.handle_id
             and t.logon_id = t0.logon_id
             and t.object_name = t0.object_name
  where rn = 1
/If there can be more than one row with "shortest time0" for same handle, logon_id, object_name the above query will return olny one of such rows. If you want to get all such rows use:
select  *
  from  (
         select  t0.time0, t0.source, t0.eventid........ , t0.accesses,
                 dense_rank() over(partition by t0.handle_id,t0.logon_id,t0.object_name order by t0.time0) rn
           from  t,
                 t0
           where t.handle_id = t0.handle_id
             and t.logon_id = t0.logon_id
             and t.object_name = t0.object_name
  where rn = 1
/SY.

Similar Messages

  • How to delete all items in download folder under bookmark in the shortest time?

    I understand that all downloads from internet and yahoo/google mail are stored in the "Download" folder which I see under bookmark when I want to delete. I think that if the download folder is never emptied, then my mac will slow down. Therefore I want to delete these downloads which I have already seen. How do I delete ALL items in the shortest time? Deleting items, even in groups, takes a long time. Is there a method that I can use so that all items in the folder are deleted in one stroke?
    Thanks.
    Unguja

    Try (first button on toolbar) Organize > Select All (Command + A) to select all items in the right pane in the Library.

  • TS2518 My RAW (nikon .NEF) files changing to a dull, darker version of themselves after selecting them for the first time after import.

    My RAW (nikon .NEF) files are literally changing to a dull, darker version of themselves after selecting them for the first time after import. I.e. The correct photo (light/color/etc) seems to be there and then a second later the photo changes. It's almost like it's showing a quick enhanced version then back to basic raw image. Started within last two updates.
    Is there a fix or is this the straw that forces a switch to Lightroom?

    Just recall that Aperture (or any other 3rd party raw converter) has NO information about the JPEG preview and how it was made.  That information is camera-vendor proprietary.
    Also note that there are like 6 "picture styles" in camera and this change you're seeing is entirely dependent on how you have them set.  If you have your camera set to "vivid" or something you'll see more of a change than if your on-camera is set to "faithful."
    That said, people here ALSO complain that Aperture's initial renders are TOO vivid, the exact opposite of your complaint, so you can't please everybody (in some cases, it seems you can't please ANYBODY ;-)
    Aperture provides a starting point.  Again, if you don't like it, you can tell Aperture to go with a "punchier" interpretation at its first render.  In the import dialog, try setting Aperture to use the "auto enhance" preset which is built in.  Aperture will add a little vibrancy adjustment, and it will add a curve, which will greatly add punch to the image.  If you want adjustments in a different direction, you can create a preset and set it at import.
    The only thing Aperture CANNOT do is what you're asking, which is "take the JPEG that my camera vendor generates through some voodoo and try and render the raw file just like that."  It's, unfortunately, impossible to do.

  • It shows incorrect time in time zone iphone 4s!! If i select 'set automatically' the london time show is wrong,how do i correct this?

    It shows incorrect time in time zone on my iphone 4s!! If i select 'set automatically' the London time, is wrong,how do i correct this?

    I recently got the same problem and noticed that it only started after I'd downloaded a particular app which used the location feature.  It was the free version of the Weather Channel that started it off and, since I've deleted it, I've not had the problem of being in Singapore or China since!
    I expect there will be other apps that cause the same issues - probably a bad piece of code being used to pick up the location function.  It might be worth trying to turn individual apps off that feature in location services to pinpoint which other apps may causing your problem.
    Hope this helps!

  • Is this the biggest price drop in the shortest time in history?

    $200 in 2 months...is this is the biggest drop in the shortest time of any product in history? what other products have seen such a drastic drop in price with respect to time? has any other company pulled such a stunt?

    30% reduction for a hardware product in 2 months is unprecedented.
    Especially if it is a successful product. Either Apple was extremely greedy with us initial purchasers charging us a 50% premium ($400 - $600) or the iPhone really isn't selling that well and a DRASTIC price cut was needed to hit volume targets.
    In either case, Apple management took advantage of its core customers. Hopefully, it will correct this fiasco soon.

  • Function that returns the date/time ?

    We would like to make a validation in the Activity status based on the activity End Time.
    Pls... is there a function that returns something that I could compare with: "8/6/2009 01:00 PM" ?
    I know of Today but I understand that today() returns just the day (no time).
    Txs.
    Antonio

    Hi Antonio,
    You can try using the function -: Timestamp()
    To quote the CRM On Demand help files...
    "+The Timestamp function in Expression Builder returns the server date and time converted to the current user's time zone setting. For example, if the current user's time zone setting is set to Eastern Daylight Time (EDT) -0400 UTC, the Timestamp function converts the server time to EDT. The TimeStamp function performs UTC (universal time code) conversion. NOTE: Arithmetic operations (for example, add or subtract) are not supported with the Timestamp() function.+"
    Hope this helps.
    Regards,
    Cameron

  • A parameter that filters and also 'Select ALL' at the same time

    Hi All,
    I have a situation
    1. I have a parameter @Param1 that accepts multiple values
    2. I have to display data based on selected values of @Param1 
    Here comes the tricky part.
    3. I have to aggregate on all the available values of the @Param1
    Can any body help me in this. 
    Do i need to take a hidden parameter just for aggregation?or is there any other way?
    Any suggestion is very helpful to me.

    Hi gangarocks,
    Based on my understanding, you want to create a multivalued parameter to filter the report, then display the selected values in the report, right?
    In your scenario, you could specify a report parameter and give available values. Then add a filter based on the parameter in the main dataset. You could add a textbox and specify the expression using Join() function. Please refer to steps below:
    1. Add a report parameter, select the “Allow multiple values” in General tab. On Available Values tab, you could check "Specify values" or "Get values from a query".
    2. In the main dataset, go to Filters tab, add a filter like below:
    3. Add an expression like below, then preview the report.
    Reference:
    Add a multi-value parameter to a Report
    SQL Server Reporting Services Using Multi-value Parameters
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Firefox disc image stays on my desktop. I can eject it, but it returns the next time I click on firefox in my doc.

    I just downloaded Firefox 4. The download folder appeared, plus the drive image. I've closed the download folder, and deleated the disc image after closing Firefox. However the next time I click on Firefox in my dock...the download folder and disc image apper on my desktop again! This is very annoying!!!!

    See if you can boot into the Safe Mode.
    Safe Mode - About
    Safe Mode

  • How to: SELECT statement returns the result in XML format.

    That's it... I want to execute a query that returns all rowset in XML format. How can I do it?
    Using Oracle 8.0 and up.
    Tnx.

    FOR XML is a proprietary Microsoft Hack... It is not supported by Oracle in any release. Oracle 9.2.x includes the SQLXML operators, which are part of the SQL:2003 standard and are the agreed upon (Mircosoft, IBM, Oracle etc) way of generating XML from relational data....
    See http://download-west.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb03usg.htm#sthref251

  • WDS 2012 R2 - Cannot PXE multiple clients at the same time

    Hello All,
    This is my first post on here so I apologize if this is the wrong place.  I work for a school district and we are implementing WDS 2012 R2.  We've been extremely satisfied with the speeds and ease of use through unattend files.  However, for
    the past month I've been looking for a possible answer to a problem that has plagued us from day one of implementation.
    So here's the problem:
    I have a stand alone WDS server which is not a domain controller and is not our DHCP server.  I have IP helpers and broadcast forwarders setup on the network.  As well as option 66 and 67 in DHCP.  So far so good right!
    Well that's partially right.  When we boot one client at a time to the WDS server.  Everything works as intended.  We can TFTP the necessary files from the WDS server.  Everything boots up and we're off and running.
    However, if we boot up two or more clients at the same time.  The WDS server never responds to the traffic.  The clients get their DHCP information.  They start the referral and download from the WDS server, but get no response.  I'm
    really hoping that someone on here would have some insight of something I can try.  I've about exhausted my list of peers and contacts.  They're all stumped as well and were smart enough to stay with 2008 WDS.
    I would prefer to stick with 2012 R2 since it's setup and working for the most part.  With only this one hiccup.
    Thanks in advance for any guidance!

    Hello Daniel,
    I appreciate the reply and apologize for taking so long to get back to this.   Things have been a little hectic over here.
    I have tried everything on this forum and I am still unsuccessful in PXE booting multiple clients at the same time.
    Multicast is enabled on the server, and it works for the clients.  However, as stated in the original post.  I cannot boot multiple machines at the same time.  I can start them from the image selection screen around the same time though.  So,
    that appears to be working fine.

  • Choose different words at the same time

    Hi,
    I think it is a bit stupid question, but I can't choose different words or lines at the same time on Pages. I try to select them at the same time I press cmd but nothing, while in other programs I can do it.
    Do you have any idea? Or is it a bug?

    No release in 17 months of Pages v5 permits multiple select of words, or lines. Pages '09 v4.3 on the otherhand, does permit it.

  • ALV copy one cell and paste into 10 cell at the same time

    Hi,
    I have editable ALV. Requirement is to 1) copy one cell value and paste into 10 selected cell at the same time. 
                                                                  2) Pull doen cell like excel to copy cell value.
    Your help would be highly appreciated.

    Just a try,
    switch the Quick cut and paste option on,now select the data then
    select the cells of the column and right click for paste.
    Im not at all sure whether this will work

  • Latest update returns error " None of the selected updates could be installed. The update could not be expanded, and may have been corrupted during downloading. The update will be downloaded and checked again the next time that Software Update runs."

    Latest update returns error " None of the selected updates could be installed. The update could not be expanded, and may have been corrupted during downloading. The update will be downloaded and checked again the next time that Software Update runs."

    Which latest update? Details get answers. Rather than using SU, DL and install from http://support.apple.com/downloads/.

  • The Popup dialog Page needs two times to return the selected value[10.1.3]

    Hi All,
    I have problem in an JSF Application that uses the EMP and DEPT tables .
    the Application contains two pages
    page 1 : a calling page uses EmpView as ADF Table .
    page 2 : a popup List of Values (LOV) dialog page uses DeptView
    These cause the popup dialog page to return to the calling page and to set the selected value into the Deptno attribute .
    the calling page includes :deptno and dname columns as
    <af:column headerText="#{bindings.EmpView1.labels.Deptno}">
    <af:selectInputText value="#{row.Deptno}"
    required="#{bindings.EmpView1.attrDefs.Deptno.mandatory}"
    columns="#{bindings.EmpView1.attrHints.Deptno.displayWidth}"
    action="dialog:ChooseDept1" id="deptnoField"
    autoSubmit="true">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.EmpView1.formats.Deptno}"/>
    </af:selectInputText>
    </af:column>
    <af:column headerText="#{bindings.EmpView1.labels.Dname}">
    <af:inputText value="#{row.Dname}" simple="true"
    required="#{bindings.EmpView1.attrDefs.Dname.mandatory}"
    columns="#{bindings.EmpView1.attrHints.Dname.displayWidth}"
    partialTriggers="deptnoField" autoSubmit="true"/>
    </af:column>
    and popup dialog page includes : Submit Button to return selected value to calling page :-
    <af:tableSelectOne text="Select and">
    <af:commandButton text="Submit">
    <af:returnActionListener value="#{row.Deptno}"/>
    <af:setActionListener from="#{row.Deptno}"
    to="#{bindings.Deptno.inputValue}"/>
    </af:commandButton>
    </af:tableSelectOne>
    the problem is
    I have to press ( two times ) the select button in the calling page to
    return the selected value into the Dname attribute .
    best regards,

    Hi,
    However, I am using the Jdeveloper 10.1.3.3, but still getting this error. I could not find any threads related to this problem and hence I wrote up here. Anyway I have also logged an SR #7179012.993 for the same with the testcase. I hope the issue will be resolved soon.
    Thanks,
    Neeraj

  • RoadMap does not return the selected step on ESS 600 Record Time entry

    RoadMap does not return the selected step on Record Time entry application in ESS. Is it suppose to behave similar way or is it suppose to take user to the selected step. If yes , then is there a setting or customization that i have to take care of, as its a standard SAP delivered ESS Record working time application.
    Please let me know. I appreciate your help in advance.

    Check with administrator in the src configuration thing,
    Cheers,
    Apparao

Maybe you are looking for

  • How do I copy a project to another computer?

    A project in FCPX has grown from its original scope. I've now got four different Events on an old iMac (maxed out with 4GB). I want to move the project to another Mac. I've copied over all of the Event folders as well as the Project folder. (Total: a

  • My itunes won't update and update won't download

    I keep getting sent to the download page, and I click and save file but it enver saves anywhere. And i can't download this stupid update.   HELP!?

  • Trial version of crystal report

    Hi, Do anyone know where to download trial version of crystal report and components to connect R3? Thx.

  • Report Painter and Exchange Rates

    We have not turned on multiple local currencies but we have several company codes that have different currencies.  Does anyone know of a feature in Report Painter that allows reporting of different currencies in one report by using some kind of curre

  • Prime Collaboration Version: 9.0.24376 CLI root/admin Password Recovery

    Dear forum users. My client needs to recover both the CLI admin and root passwords for their PCA and PCP VM appliances, Version: 9.0.24376, don't ask why! Is the attached document the correct method to do this?