Cannot get wanted data with MAX and GROUP BY function

Hi
All
I have a table like below:
COLUMN     TYPE
USER_ID     VARCHAR2 (10 Byte)
PROCESS_ID     VARCHAR2 (30 Byte)
END_TIME     DATE(STAMP)
TO_LOC     VARCHAR2 (12 Byte)
TO_LOC_TYPE     VARCHAR2 (15 Byte)
FROM_LOC      VARCHAR2 (12 Byte)
ITEM_ID     VARCHAR2 (25 Byte)
CASES     NUMBER (12,4)
LMS_UDA1      VARCHAR2 (250 Byte)
ZONE     VARCHAR2 (2 Byte)
I only want get one record with all columns, only have one clause MAX(END_TIME)
But the other column have difference value.
when i use MAX(END_TIME) and GROUP BY USER_ID,PROCESS_ID,CASES,....
the sql didnot give one record,
It give many records
Please help me on this
Regards
Saven

Hi, Saven,
Sorry, it's unclear what you want.
Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Explain, using specific examples, how you get those results from that data.
If you can show your proiblem using commonly available tables, like those in the scott or hr schamas, then you don't have to post any sample data: just the results and the explanation.
Always say what version of Oracle you're using.
See the forum FAQ {message:id=9360002}
Are you trying to see all data related to the highest (that is, latest) end_time?
I think you want something like this, that finds all the ionformation about the employee with the latest hiredate:
WITH     got_r_num     AS
     SELECT     emp.*
     ,     ROW_NUMBER () OVER (ORDER BY  hiredate  DESC  NULLS LAST)
               AS r_num
     FROM     scott.emp
SELECT     *     -- Or list all columns except r_num
FROM     got_r_num
WHERE     r_num     = 1
;What do you want in case of a tie, that is, if 2 or more rows have the same latest end_time? You may need to add tie-breaking expressions to the analytic ORDER BY clause, and/or use RANK instead of ROW_NUMEBR

Similar Messages

  • TableModel with SORT and GROUP BY functions solution.

    Hello all,
    I'd like to represent an EnvelopeTableModel. This class is developed to incapsulate another TableModel and allow user to reorder and group data without changing original values and orders.
    It allows to perform multi column sortings and grouping and
    supports following group functions: EMPTY, COUNT, MIN, MAX, SUM, AVG.
    Here you can download the library, demo version and documentation.
    http://zaval.org/products/swing/
    It would be great to know all your opinions.
    With best regards
    Stanislav Lapitsky

    About 1) and 3).
    These suggestions are almost the same. These features will change GUI component but i want to improve TableModel instead of JTable.
    Using the model user can use JTable for data representation.
    Of course I can improve JTable component and add multiline row/column headers with ability to reorder/group data from component and a lot of another widgets but it isn't my goal.
    About 2) What do you mean "crosstab"?
    Thanks for your 2-cents :-).
    With best regards
    Stas

  • Hi! I've got CS3 Design Standard - the actual disks and Software License certificate. It was installed on my laptop which crashed and could therefore not be uninstalled. I have now installed it on my new MacBook Pro, but cannot get it registered with the

    Hi! I've got CS3 Design Standard - the actual disks and Software License certificate. It was installed on my laptop which crashed and could therefore not be uninstalled. I have now installed it on my new MacBook Pro, but cannot get it registered with the serial number. Is it because it wasn't uninstalled on the previous laptop? What to do now?? Thx!

    Maybe this can help someone else...  I simply had to properly uninstall CS3 and reinstall it again after that.  I think that sorted it!  I also remember having a similar issue with Macs at work a couple of years back.  Not sure whether the same applies to CS5/CS6.  Here's a link on how to properly uninstall CS3 on Windows XP, Windows Vista and Mac OS.  I'm on OS X 10.9.2 but it worked just fine.  Remove Creative Suite 3 and CS3 products

  • I have a problem with mail.  the spelling and grammer check box before sending the messege is no longer there.  I did everything but cannot get it back.  is ther anyone who knows how to get the box with spelling and grammer checks before sending

    i have a problem with mail.  the spelling and grammer check box before sending the messege is no longer there.  I did everything but cannot get it back.  is ther anyone who knows how to get the box with spelling and grammer checks before sending the mail.
    Also the mail is acting very funny by not getting the rules work in a proper method.  Is ther a software to repair mail.

    i did both of them, but still the while sending the mail the diolog box is not showing up and also the spelling and grammer does not do the spelling check. 
    This problem just started for about 3 to 4 days now.  earlier it was working normally.

  • HT1338 ical error pop up, "The server responded with an error". Cannot get it to go away and cant use my ical because of it

    ical error pop up, "The server responded with an error". Cannot get it to go away and cant use my ical because of it

    How are you syncing your contacts?
    Contacts Troubleshooting
    Contacts - Troubleshooting iCloud Contacts

  • Can I get an Ipad with wifi and cellular but no contract with a carrier in the US?  I want to use it overseas in Africa with a local SIM card and use the cellular signal for all my internet.

    Can I get an Ipad with wifi and cellular but no contract with a carrier in the US?  I want to use it overseas in Africa with a local SIM card and use the cellular signal for all my internet. 

    Yes you can.  All Ipad's are unlocked and can be used any where in the world. Buy the AT&T version which is GSM in other countries

  • I cannot get my iMac with built-in airport to allow internet connections to Nook and PS3. The devices access the network, but internet connection fails. Internet sharing is enabled, network security (WEP, WPA) is completely off.  What to check next?

    I cannot get my iMac with built-in airport wi-fi to allow internet connections to Nook and PS3. The devices access the network, but internet connection fails. Internet sharing is enabled, network security (WEP, WPA) is disabled.  What to check next?

    On an additional note, I've purchased a wireless router and everything connected on the first attempt.  It just vexes me that the built-in wireless isn't working as a router.  Is this another example of "Mac only plays with Mac"?

  • Application exe file cannot get FieldPoint data

    I built an application exe file from my development notebook computer (Win XP) that have LV7.1 and Max 3.1. The stand alone exe file runs well in the same notebook. But it could not get any FP data when it is running from a target computer (Win 2000). I found that Max was version 3.0 (FP version 4.0) in the target computer. The development notebook has MAX 3.1 (FP version 4.1). Is this the reason I cannot get FP data (temperature and other paramenters)?

    The version difference is probably one of the problems. A second problem may be that the resource/device/item names that are configured in MAX, and/or the IAK file name may be different on the second machine so the EXE may be trying to access a non-existant item.
    Regards,
    Aaron

  • Get the data  from excel and insert into the database

    I want to read the data from excel file, get the data from excel and insert into the database.

    You can use the Apache POI HSSF API to read data from Excel files and you can use the Sun JDBC API to insert data in database.
    This has nothing to do with JSP/JSTL.

  • Is there a way to find out whether my imessages are being received by a specific iphone user or if there is a problem with their phone? Cannot get in touch with an out of state friend for several days.

    I'm looking for a way to check and see if a specific iPhone user is receiving my imessages or if there phone is not working properly.  I cannot get in touch with an out of state friend for several days and the only number I have is to their cell (iphone).  Thank you.

    YYou can only get a read receipt, not if they only received it.
    http://m.imore.com/how-turn-and-read-receipts-imessage

  • Cannot get Membership Provider with name RoleProvider. The membership provider for this process was not properly configured. You must configure the membership provider in the .config file for every SharePoint process.

    I am trying to create a web application that uses AD LDS as its authentication provider. I have followed all the steps and verified all the web.config files, but I receive the error below:
    Cannot get Membership Provider with name CustomRoleProvider. The membership provider for this process was not properly configured. You must configure the membership provider in the .config file for every SharePoint process.
    Has anyone come across this error before?

    There seems to be some issues in your web.config files. Please make sure your Web application entries for membership and role provider(at central admin site) are matching with Web.config entries. your error
    "Cannot get Membership Provider with name CustomRoleProvider.
    ", indicating that you may have used role provider name in Membership provider text box or in web.config.
    Also please make sure that you have correct entries in all 3 web.config files - Central Administration , Security Token Service (STS), Web application .
    Please refer  -
    Forms Based Authentication (FBA) in SharePoint 2013
    Thanks
    Ganesh Jat [My Blog |
    LinkedIn | Twitter ]
    Please click 'Mark As Answer' if a post solves your problem or 'Vote As Helpful' if it was useful.

  • Hard currency is not valuated in FAGL_FC_VAL along with local and group currency

    Hi All,
    I have the below system settings for FOREX revaluation. The revaluation is not happening for Hard currency along with local and group currency. The test data and other settings seams to be fine as the below mentioned workaround works perfectly for hard currency revaluation.
    I would like to take your expert feedback on this issue to confirm whether this is how SAP works or its an issue with FAGL_FC_VAL program.
    System Settings:
    Currencies in company code
    local currency      group currency      hard currency
    10                             30                         40
    USD                          USD                    UYU
    FOREX settings:
    Work around found:
    Define two Valuation area, say
    1. Valuation Area: A1 which will have currency type 10 and 30.
    2. Valuation Area: A2 which will have only the currency type 40.
    3. Run FAGL_FC_VAL twice for these area.
    Issue with this work around:
    1. The valuation area is assigned to one accounting principle (which is in turn assigned to a specific ledger).
    2. Thus, if I have different accounting FOREX process to be followed in different ledgers (say IFRS ledger, Local Ledger, Tax ledger) then I need to create 2 valuation area (as per above workaround) for each ledgers and run FAGL_FC_VAL for each of these valuation areas.
    Thanks & Regards
    Nikhil Kothari

    Hi Experts,
    Any views on the above issue?
    Thanks & Regards
    Nikhil Kothari

  • What Are The Minimum Permissions In Order An User To Be Able To Access User Profile Data With JavaScript And REST API

    The question says it all:
    What Are The Minimum Permissions In Order An User To Be Able To Access User Profile Data With JavaScript And REST API.?
    In the User Profile -> Permissions there is only the option for "Full Control".

    Hi Nikolay,
    Thanks for posting your issue, you need to set permissions on User Profiles = Read. Kindly find the below mentioned URLs to get the code and more details on this.
    http://www.vrdmn.com/2013/02/sharepoint-2013-working-with-user.html
    http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
    http://sharepoint.stackexchange.com/questions/61714/sharepoint-2013-call-the-rest-api-from-sharepoint-hosted-app
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/04/09/how-to-query-sharepoint-2013-using-rest-and-javascript.aspx
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • Logs are generating with owner and group as 'root'

    Hi,
    In our newly installed and configured Oracle application server(10.1.3.5), the logs are generating with owner and group as 'root'.
    Location: $ORACLE_HOME/Apache/Apache/logs
    -rw-r----- 1 root root 6700 Apr 3 02:03 access_log.1364947200
    -rw-r----- 1 root root 430 Apr 3 02:04 error_log.1364947200
    We have configured it on port 80. For this the '.apachectl' ownership and permissions are changed as below:
    -rwsr-s--- 1 root dba 1703780 Jul 21 2009 .apachectl
    Kindly let me know what are the changes to be made, for the logs to be generated with the group as 'dba' instead of 'root'.
    Thanks.
    Edited by: 985284 on Apr 3, 2013 3:14 AM
    Edited by: 985284 on Apr 3, 2013 4:22 AM

    Ok - that is quit weird then. If you want to run the HTTP Server on a privileged port, you basically change the ownership of the .apachectl executable :
    cd ORACLE_HOME/Apache/Apache/bin
    chown root .apachectl
    chmod 6750 .apachectlas per [url http://docs.oracle.com/cd/B25221_05/core.1013/b25209/ports.htm#CIHJEEJH]documentation.
    Your user and group directive should be set to :
    User oracle
    Group dbaUpon starting, the http server would start as root and then switch the effective userid of the process from root to oracle. In the process list (ps -ef | grep httpd), you should see oracle.
    Do you have the same configuration and what do you see in the process list?

  • I have an iMac from 2008.  When I start I get gray screen with apple and turning gear. Next blue screen. Then light blue screen with turning gear. Back to blue screen.  Now just back and forth blue to light blur

    I have an iMac from 2008.  When I start I get gray screen with apple and turning gear. Next blue screen. Then light blue screen with turning gear. Back to blue screen.  Now just back and forth blue to light blur

    Reinstall OS X:
    Reinstall OS X without erasing the drive
    Do the following:
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install the Combo Updater for the version you prefer from support.apple.com/downloads/.
    Reinstalling Lion Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion: Select Reinstall Lion and click on the Continue button.
    Note: You can also re-download the Lion installer by opening the App Store application. Hold down the OPTION key and click on the Purchases icon in the toolbar. You should now see an active Install button to the right of your Lion purchase entry. There are situations in which this will not work. For example, if you are already booted into the Lion you originally purchased with your Apple ID or if an instance of the Lion installer is located anywhere on your computer.

Maybe you are looking for

  • Flash --- Dreamweaver (.asp)

    I trying an old version of Flash and trying to determin if it will be worth it to use and I've run into a problem that I don't understand. We have a site made with .asp. I mad a flash file and went through the publishing with no problem, but here is

  • Archival services with Flash Media Server

    I work for a broadcasting company and we do live telecast of various events, mostly related to professional sports. We currently have a Windows Media Encoder 9 setup with Windows Media Server, etc. I have a custom written application that archives al

  • Unsure how to copy current contents of iPod back to iTunes for future use

    Had a system failure that required operating system upgrade to Windows Vista. This left iPod with orphaned content that does not show on iTunes. Am afraid that if I put new content on the iPod, the old would now be gone forever. Looking for a ready-a

  • Error display in camera app

    in the camera app, there is a problem with the text for the timer in some language

  • Perform incremental backup to drive which has moved?

    I used Time Machine in 10.5 for the first time a few days ago, before installing Snow Leopard. I used a drive connected to the USB port. After installing Snow Leopard, Time Machine performed incremental backups to the same drive. Today I disconnected