Optimized way of finding the correct tuple.

i have a table which has parameters as
date time value
0 0 q
10/10/07 15:00 k
10/10/06 15:00 U
20/12/08 15:00 R
01/11/09 15:00 I
10/10/09 15:00 E
Data and time are the ranges(start ranges) and there values after that time e.g from (0,0) to ( 10/10/06,15:00) the value will be q and then till (10/10/07 15:00) will be k
I need to find a optimized query in which after supplying data and time , i get the value.
Currently :-
SELECT MAX(date) INTO :ora9_fromdate FROM pap where data<current date;
select FROMDATE, FROMTIME,value from pap where date= ora9_fromdate and time = (select max(time) from papa where date= ora9_fromdate)

Hi,
I'm not sure I understand the problem. Post CREATE TABLE and INSERT statments for the table you posted, CREATE TABLE and INSERT statements for a set of test dates, and the results you want to get for each of those test dates, given the first table.
Why not store the date and time tiogether in on DATE column?
Queries on this table will be more efficient if you can store the next date on each row, so each row of the table has a beginning date and an ending date (actuall, 1 second past the eneding date). That's not hard to compute, using the anlytic LEAD function, but you'd have to do it whenever the table changed (perhaps in a trigger).
How is this table maintained? For example, do you only add new rows with a date after that latest existing date, and rarley update existing rows?
If you can't store the ending date in the table, then what you have now is the best approach. You can make it a little faster by uisng only one query, with the LAST function, like this:
SELECT  MAX (from_dt_tm)                         AS from_dt_tm
,      MIN (value) KEEP (DENSE_RANK LAST ORDER BY from_dt_tm)     AS value
FROM      pap
WHERE      from_dt_tm     <= :target_dt_tm
;

Similar Messages

  • Dont find the correct video drivers for my T61 + windows 7 ultimate + intel pm965 video card

    Hi Experts,
    I am keep getting the stop error 0x00000116 failing with a blue screen while im browsing. I have observerd this quite a few times and also I could not find the correct video drivers for my t61 thinkpad in the ibm site. I could see the details as wxp & windows vista but not for win 7. Please find the link below which has all the video drivers fro t61. Please help me find the correct customized video drivers fro my t61 + win 7. Hope you understand my problem.
    By the way i just use for home computing and my win 7 is upto date wiht no extra software and games installed. I dont play games at all on my t61.
    my t61 specificaitons : http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-67883
    If you see the link http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-67853
    if u search in the baove link ,you cannot find the video drivers for t61 + win 7. You have it only for xp & vista in this section. Intel X3100 (940GML, 945GM, GL960, GM965). there are no video drivers for win 7 for t61. my video card info is
    Video chipsets:
    Intel PM965/GM965 graphics. (15.4 inch).
    my video card is Intel PM965 chipset . Please help me to get the correct customized version of the video drivers for my thinkpad as I am getting this problem with video drivers and its getting restarted when I am in the middle of something. But it works find after that. I have tried to install drivers from intel and its saying i have customized version of lenovo drivers and I should contact you guys. I triedcomplete  win 7 update from windows site and installed all patches and still getting the problem intermitently, but after restart it works fine. No hardware or software changes. Its that I need the correct version of video drivers for win 7. Please inform the lenovo about this and ask them to develop the good video drivers for win 7 + t61 model. Hope you understand my situation.
    Please let me know if you need any kind of info so that i can provide.
    thanks for reading the mail.
    Regards,
    Manu

    Are you kidding me ? You dont work for Lenovo and you are an active volunteer here in this forums. I have seen your replied many times and wont get paid by Lenovo, you are really crazy for ur stufee .Anyways thanks a lot for the link and the original lenovo staff were notable to provide the link and you could. Well I have tried that what you have said nd still I could not get the link, here you go..
    http://www-307.ibm.com/pc/support/site.wss/product.do?doccategoryind=50880&template=%2Fproductpage%2...
    Let me install the drivers from your link and I will reply soon, so who ever search in this forum now , there wont be any problems for t61 windows 7 video drivers because of u. You are awsome.wll reply my results soon.

  • DB13 can not find the correct controlfile.

    My environment is
    Win2003
    Oracle 10g
    Ecc 6.0
    When I use DB13 for the full offline backup, I get the following message:
    BR0051I BRBACKUP 7.00 (13)
    BR0055I Start of database backup: bdtelngh.afd 2006-08-02 21.01.03
    BR0252W Function remove() failed for 'D:\oracle\DEV\102\database\sap.ora' at location BrInitOraCreate-1
    BR0253W errno 13: Permission denied
    BR0252W Function remove() failed for 'D:\oracle\DEV\102\database\sap.ora' at location BrInitOraCopy-7
    BR0253W errno 13: Permission denied
    BR0166I Parameter 'control_files' not found in file D:\oracle\DEV\102\database\initDEV.ora - default assumed
    BR0274W File 'D:\oracle\DEV\102\database\CTL1DEV.ORA' not found
    BR0101I Parameters
    Name                           Value
    oracle_sid                     DEV
    oracle_home                    D:\oracle\DEV\102
    oracle_profile                 D:\oracle\DEV\102\database\initDEV.ora
    sapdata_home                   D:\oracle\DEV
    sap_profile                    D:\oracle\DEV\102\database\initDEV.sap
    backup_mode                    ALL
    backup_type                    offline_force
    backup_dev_type                disk
    backup_root_dir                D:\oracle\DEV\sapbackup
    compress                       yes
    compress_cmd                   D:\usr\sap\DEV\SYS\exe\nuc\NTI386\mkszip -c $ > $
    uncompress_cmd                 D:\usr\sap\DEV\SYS\exe\nuc\NTI386\uncompress -c $ > $
    exec_parallel                  0
    system_info                    SAPServiceDEV JXCDEV Windows 5.2 Build 3790 Service Pack 1 Intel
    oracle_info                    DEV 10.2.0.2.0 8192 1870 13112942
    sap_info                       700 SAPSR3 DEV U0388471103 R3_BASIS 0002894446
    make_info                      NTintel OCI_10103_SHARE Apr  2 2006
    command_line                   brbackup -u / -jid ALGOF20060802210000 -c force -t offline_force -m all -p initDEV.sap -w use_dbv -a -c force -p initDEV.sap -s -w
    BR0116I ARCHIVE LOG LIST before backup for database instance DEV
    Parameter                      Value
    Database log mode              Archive Mode
    Automatic archival             Enabled
    Archive destination            D:\oracle\DEV\oraarch\DEVarch
    Archive format                 ARC%S_%R.%T
    Oldest online log sequence     1867
    Next log sequence to archive   1870
    Current log sequence           1870       SCN: 13112942
    Database block size            8192       Thread: 1
    BR0118I Tablespaces and data files
    Tablespace     TS-Status  F-Status  File                                                       Size   Id.     Device  Link    Type       MaxSize     IncrSize  BlkSize
    PSAPSR3        ONLINE*    ONLINE+   D:\ORACLE\DEV\SAPDATA1\SR3_1\SR3.DATA1
    BR0120I Control files
    File                                                Size   Id.      Device  Link    Type
    D:\oracle\DEV\102\database\CTL1DEV.ORA              8192    0            0  NOLINK  FILE
    BR0280I BRBACKUP time stamp: 2006-08-02 21.01.09
    BR0115I Compression rate for all files 5.8422:1
    BR0056I End of database backup: bdtelngh.afd 2006-08-03 06.07.57
    BR0280I BRBACKUP time stamp: 2006-08-03 06.07.59
    BR0053I BRBACKUP completed successfully with warnings
    BR0280I BRBACKUP time stamp: 2006-08-03 06.07.59
    BR0291I BRARCHIVE will be started with options '-U -jid ALGOF20060802210000 -d disk -c force -p initDEV.sap -s -w'
    BR0280I BRBACKUP time stamp: 2006-08-03 06.08.06
    BR0292I Execution of BRARCHIVE finished with return code 1
    1.It seems the correct control file can not been found.
    I have checked the file "initDEV.ora" and spfile.In them the positions of control file are  "/origlogA/cntrl","/origlogB/cntrl" and "/sapdata1/cntrl".
    So I donot know why the process of DB13 cannot find the correct control file and search the file CTL1DEV.ORA.
    Because the correct control file could not been backuped,I can not restore and recover the database.
    What causes it?
    2.
    BR0252W Function remove() failed for 'D:\oracle\DEV\102\database\sap.ora' at location BrInitOraCreate-1
    BR0253W errno 13: Permission denied
    BR0252W Function remove() failed for 'D:\oracle\DEV\102\database\sap.ora' at location BrInitOraCopy-7
    BR0253W errno 13: Permission denied
    How can I solve this warning? And why it occurs?
    Anyone can help me?
    Thanks!
    Ryan Fung

    Praveen,
    I had the same problem as Ryan and Gary on a new XI \ Oracle 10g installation and your suggestion did solve this.  It seems that when you run the first BRTOOLS based backup, Oracle tries to create a PFILE from the automatically generated SPFILE, but the DB user doesn't have rights to delete the SAP.ORA file.  Once you assign SAP_<SAPSID>_GOBALADMIN full rights to the Oracle folder, an updated INIT<SID>.ORA is generated and the default SAP.ORA is deleted on the next BRTOOLS backup run.
    Thanks for the tip.
    Rgds,
    Andrew

  • Is there a way to find the serial number in these files so that I can reinstall the full version?

    I had to restore from backup to a new hard drive, and only have part of my Adobe Photoshop installation. Is there a way to find the serial number in these files so that I can reinstall the full version?  I have only part of the documentation so this is the best way I see to get the full version back.

    Hello brad,
    you did purchase your product from these firms like Amazon, so you didn't get a serial number, only a code with which you can request a serial number from Adobe. Please have a look at http://helpx.adobe.com/x-productkb/global/find-serial-number.html. (Start here: How did you purchase your product?)
    The following part, so I just see at least, ceased to exist on my Adobe website, everything takes place in the link from above. I leave it as an info yet, it might still fit for you. For this purpose, please click your way through to your Adobe Store and find the button "Get Serial Number". Fill in the form and after a while you will get the real serial number.
    Additionally you should have a look at Adobe's database, to see what's stored/saved about your accounts. Here you will find general infos about your Adobe Account.
    On the other hand, if necessary and for further questions click through http://helpx.adobe.com/contact.html and if "open" please use the chat, I for may part had the best experiences. I quote from Adobe's employee Preran: The chat button is activated as soon as there is an agent available to help.
    Hans-Günter

  • Is there a way to get the correct order from the dependent types of a sche

    Hi ,
    I have a CT facing the following problem:
    When trying to built a SQL script to create all the object types within a schema using the DBMS_METADATA packages.
    Did insert in a table the names of the types that will be exported following a concrete order, next loop into the table and call the DBMS_METADATA package for each row.
    These type are depedent between them, there are some type attributes calling other types and here the issue
    First : try to generate the order by created column of dba_objects and when the generated SQL script is launched a lot of type appearing as incomplete state due to the order isn't correct.
    Second : try to insert the table ordering by object_id colums of dba_tables view, it appears incomplete types too.
    Currently want to insert the table using a recursive query with connect by against the dba_type_attrs starting with the rows when ATTR_TYPE_NAME is not null (the types that are called by other types), but this way has a issue dificult to resolve: the roots of hierarchy are the rows when ATTR_TYPE_NAME is not null and we've dependencies between roots nodes
    The question is is there a way to get the correct order from the dependent types of a schema?
    Platform: IBM SP AIX
    DB version: 9.2.0.7
    Any help will be appreciated .
    Thanks in advance.

    The xxx_dependencies view should give you the dependencies betwee nthe various types. I would look at something along the lines of:
    SELECT object_name, referenced_name
    FROM (SELECT o.object_name, d.referenced_name
          FROM user_objects o, user_dependencies d
          WHERE o.object_name = d.name(+) and
                o.object_type = d.type(+) and
                d.referenced_type(+) = 'TYPE' and
                o.object_type = 'TYPE')
    START WITH referenced_name IS NULL
    CONNECT BY PRIOR object_name = referenced_nameThe outer join between user_objects and user_dependencies is required to generate the names of types which are not dependent on other types, or do not have other types dependent on them.
    HTH
    John

  • Is there a way to find the list of PCs and iDevices connected to my Itunes Match?

    Is there a way to find the list of PCs and iDevices connected to my Itunes Match?

    Is there a way to find the list of PCs and iDevices connected to my Itunes Match?

  • I have files that freeze my programs whenever I try to open ANY file. Is there a way to find the exact files causing the crash?

    I have files that are freezing my programs (adobe; after effect and photoshop, as well as maxon cinema 4d). Whenever I try to import ANY file from within the program it doen't even let me select the file I need before freezing. I have moved all files off my desktop and into my dropbox, and it now allows me to import files/search for files on the desktop but NOT dropbox, once I go to dropbox it freezes again. I am assuming there are files within dropbox now that are crashing my programs. The problem is I have a lot of files in there and would like to remove the corrupt ones so that I can use my programs without freezing. Is there a way to find the exact files causing the crash?
    This has happened a couple of times and each time I have to move all my files off my desktop, so there must be a type of file doing this, I just don't know what files they are.
    Mac Book Pro 15" running OSX 10.9
    Processor  2.3 GHz Intel Core i7
    Memory  16 GB 1600 MHz DDR3
    Graphics  Intel Iris Pro 1024 MB
    ANY help would be greatly appreciated! It is making it really hard to get work done. THANKS!

    This error sounds to me like you have/had BootCamp Windows installed and then removed, posible ?
    If so (and even if not so), try restating your MBA while holding down the alt/option-key until you get to the Boot Selection Screen.
    Choose to boot OSX.
    Once in OSX go to System Preferences then Startup Volume and set your OSX to be the default.
    Hope it helps
    Stefan

  • My mac book wont recognize my ipod. My Ipod will make the initial connected sound saying its charging but otherwise theres no way of finding the Ipod anywhere on the computer or Itunes.

    My mac book wont recognize my ipod. My Ipod will make the initial connected sound saying its charging but otherwise theres no way of finding the Ipod anywhere on the computer or Itunes. Please help with anyway I can get the Ipod recognized so I can download music from Itunes to my Ipod. Thanks in advance.

    Hello xerxes.nashion,
    It sounds like your iPod is not recognized by iTunes or your MacBook Pro.  I recommend following the steps in the article below for an issue like this:
    iPod not recognized in iTunes and Mac desktop
    http://support.apple.com/kb/TS1410
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How I find the correct iTunes account?

    I just reloaded my pc laptop and when I tried to sync my iPad a message said I was on a different account and if I continued to sync my iPad was going to be erased. How can I find the correct iTunes account?

    By "reloaded my pc laptop" I take it you mean you wiped the PC and restored it back to factory settings? If so did you backup all your documents and data first? Normally your user profile contains a Music folder which in turn holds the iTunes folder. All the important details of your library are in there, with the media below in a folder called iTunes Media. If you lose this information and then connect your device to an empty iTunes library it will want to clean it out and start over.
    You should be able to recover the media with the tips in  this post from forum regular Zevoneer but I'm not sure what the implications are for your application settings. You can probably transfer your purchases into an authorised library, backup the device, recover any other media using third party tools, then restore the device from the backup. That might switch the assocation of the device to the new machine but I couldn't say for sure.
    tt2

  • Can someone please help me find the correct driver for my audio ca

    Hello, it's famke again...Still trying to find drivers.. My sound card is apparently also missing drivers... I've tried many drivers from different sites matching the information i've taken off the card...but for some reason i always get a big red slash through my audigy sound control panel after trying to install the driver and reboot my system... I'm convinced i haven't been able to find the correct driver... The information off the card is...Soundblaster Audigy 2ZS M:SB0350... If anyone can help out i would greatly appreciate this...Famke.

    I'm new to this, but I also had trouble for a while in finding and installing the right drivers. Eventually I got it to work with the link below. Follow the steps and select everything it suggests (I did and it worked for me). You might want to try it and see if it works for you too. Good Luck. http://www.creative.com/language.asp...wnloads/su.asp

  • Hi all! What is the best way to create the correct space for baseball jersey names and numbers? along with making sure they are the right size for large printing.

    What is the best way to create the correct space for baseball jersey names and numbers? along with making sure they are the right size for large printing.

    Buying more hard drive space is a very valid option, here.  Editing takes up lots of room, you should never discount the idea of adding more when you need it.
    Another possibility is exporting to MXF OP1a using the AVC-I codec.  It's not lossless, but it is Master quality.  Plus the file size is a LOT smaller, so it may suit your needs.

  • Best way to find the count of rows affected by a query

    Hi All,
    Is there a way to find the row count without actually executing the SQL statement? The count need not be accurate but it should be within acceptable limits. I know we can use 'explain plan' for this. But the value in plan_table.cardinality is way out of the actual expected count.
    We would appreciate any pointers and/or suggestions.
    Thanks
    Edited by: user779842 on May 4, 2011 2:21 AM

    maybe you can try this
    How to get estimated number of rows of query without running actual query :
    CREATE OR REPLACE FUNCTION get_rows_number (sql_select VARCHAR2, sql_id VARCHAR2) RETURN NUMBER AS
    rows_number NUMBER;
    BEGIN
    EXECUTE IMMEDIATE
    ‘EXPLAIN PLAN SET STATEMENT_ID = ‘||CHR(39) || sql_id || CHR(39)||’ FOR ‘ || sql_select;
    SELECT t.cardinality
    INTO rows_number
    FROM plan_table T
    WHERE statement_id = sql_id AND ID = 0;
    RETURN rows_number;
    END;hope it helps!

  • Is there a way to find the Time Duration for applying a Patch?

    Dear Legends,
    Is there a way to find the Installation or Applying time can be gauged for a PATCH, so that it will be useful to provide the DOWNTIME of the server.
    Thanks in Advance
    Regards,
    Karthik singh

    karthiksingh_dba wrote:
    Dear Legends,
    Is there a way to find the Installation or Applying time can be gauged for a PATCH, so that it will be useful to provide the DOWNTIME of the server.
    Thanks in Advance
    Regards,
    Karthik singhNot until you test the patch and install it yourself on one of the instances. Once you apply the patch, you can check the patch log file or the patch analysis report or AD_BUGS table.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Patch+AND+Analysis+AND+Report&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    You can run the patch with apply=n but this will let you to test the patch before applying it only.
    http://docs.oracle.com/cd/E18727_01/doc.121/e12148/T531058T531065.htm#adptpptpbai
    http://docs.oracle.com/cd/E18727_01/doc.121/e12148/T531058T531062.htm#adptpaucla
    Thanks,
    Hussein

  • Please tell me the way to find the person who has booked the conferenceroom

    HI All,
    When i am trying to book a conference room. it was showing the status a s busy in zimbra.But i am not able to find the person who has booked the room ?? how do i know the person who has booked teh conference room??if i can know that person i can negiotate with him abt the room.
    please tell me the way to find the person who has booked teh conference room ?????
    Thanks in advance
    Venugopal

    Hi Venugopal,
    If you add approvers using beekeeper for that resource AND that you use Outlook, you can see who is 'in charge' of that resource, ie the person that will hand over the keys to that room when you need them. That person is the only one who may be able to tell you who has booked the resource, you can then go and 'negociate' ;o)
    In Zimbra (1.5.1.5) you can't see the contacts..
    hth
    David

  • Windows dos not recognize mi apple tv it say it cant find the correct driver and it doesnt work do anybody know how to download the correct driver?

    Does any body can tell me hoy can i find the correct driver, i tried everything, unistall de actual drver, and let windows tu search for the driver and nothing, it seems keep telling me it doesnt find the driver, itunes doesnt recognize mi appletv, what can i do?

    Hi:
    Install the above driver and that will install both the ethernet driver and co-processor driver.
    You have a problem with the wireless card...could be minor, could be major.
    The wireless card is missing from the device manager.
    Install this software, reboot, and see if you can turn on the wireless card by using this software.
    http://h20564.www2.hp.com/hpsc/swd/public/detail?s​p4ts.oid=3357379&swItemId=ob_76368_1&swEnvOid=4052
    If that doesn't get the Network Controller device to show up so that you can post the hardware ID for it, then the motherboard is shot.  Power to the slot that the wireless card is connected to has been cut.
    Very common problem with the Nvidia chipset motherboards with the amd processors.

Maybe you are looking for

  • How to know the name of a message catalog

    Hi , is it possible to know the name of a message catalog at runtime (ie: 'myappli.cat' in place of qqlo_MessageCatalog) ???? thanks. Cordialement. Patrice Bourdon Alliance Sante France Tel : (33) 02.54.60.26.27 Fax : (33) 02.54.60.25.00 e-mail: mail

  • Date to Elapsed Days Conversion

    Hello Guys I need guidance in Date to Days Conversion Lets Suppose i have a string as following var time:String = "2009-09-01" and as today is 5 so i want a value like "4 Days Ago" How could i convert this date to days? Thanks in advance

  • Nokia 3110 classic...Themes corrupted

    Hi, I have a problem with my nokia 3110 classic phone. When I go to the themes sec it says themes corrupted. Also my phone switches off itself and all my messages , themes, wallpapers, tones, graphics, games, etc disappear... Please help me solve thi

  • Consolidation Extractors

    Hello, When trying to extract data from consolidation mudule using extractor 3EC_CS_1A, it giving an error "No consolidation frequency for cons group". I checked the consolidation configuration, every thing looks fine. Any Ideas? Thanks, Ravi.

  • Multiple monitor display

    I have Probook 6570b running Windows 8.1 Professional 64 bit Probook has the Intel HD Graphice 4000 Display Adapter All firmware and software up-to-date HP 90W Docking Station Two external monitors with a mix of HDMI, DVI and VGA inputs available How