Latest rates

I have table named as PRICE, i want to extract the latest rate for the item 'AAA' 


CREATE TABLE PRICE
(
  ITEM_NAME  VARCHAR2(40 BYTE),
  RATE       NUMBER,
  EFF_FROM   DATE,
  EFF_TO     DATE
)


INSERT INTO PRICE(ITEM_NAME, RATE, EFF_FROM, EFF_TO) VALUES('AAA',20, '01-APR-2011','30-APR-2011');
INSERT INTO PRICE(ITEM_NAME, RATE, EFF_FROM, EFF_TO) VALUES('AAA',30, '01-MAY-2011','30-MAY-2011'); 
INSERT INTO PRICE(ITEM_NAME, RATE, EFF_FROM, EFF_TO) VALUES('BBB',20, '01-JUN-2011','30-JUN-2011');  

Query
---------
SELECT ITEM_NAME, RATE
FROM   PRICE
WHERE  ITEM_NAME = 'AAA'

Sanjay

Use the RANK and DENSE_RANK function

select item_name, rate
  from (select item_name, rate, dense_rank() over(partition by item_name order by eff_from desc) rk
         from price)
 where rk = 1

Tags: Database

Similar Questions

  • Recover latest data from date

    CREATE TABLE PRICE
    (
      ITEM_NAME  VARCHAR2(40),
      RATE       NUMBER,
      EFF_FROM   DATE,
      EFF_TO     DATE
    )
    
    
    INSERT INTO PRICE(ITEM_NAME, RATE, EFF_FROM, EFF_TO) VALUES('ABC',21.5,'19-NOV-2008','26-NOV-2010');
    INSERT INTO PRICE(ITEM_NAME, RATE, EFF_FROM, EFF_TO) VALUES('ABC',23,'27-NOV-2010','31-MAR-2012');
    
    SELECT * FROM PRICE
    
    For the item ABC there are tow different rates for different period.
    
    How to write a query to get the rate of the latest period ? Kindly suggest ?
    Sanjay

    Hello

    I made a mistake in the original message. Try what is today displayed:

    SELECT     MAX (eff_to)
    ,     MIN (rate) KEEP (DENSE_RANK LAST ORDER BY eff_to)     AS last_rate
    FROM     price
    ;
    

    Another approach is:

    WITH     got_r_num     AS
    (
         SELECT     item_name, rate, eff_from, eff_to
         ,     RANK () OVER (ORDER BY eff_to DESC)     AS r_num
         FROM     price
    --     WHERE     ...     -- IF YOU NEED ANY FILTERING, PUT IT HERE
    )
    SELECT     item_name, rate, eff_from, eff_to
    FROM     got_r_num
    WHERE     r_num     = 1
    ;
    

    As you can see, it's a bit more coidng, but it is much more flexible. For example, it can easily show any number of columns in the row with the last eff_to, it can manage the links in different ways, and it can show you the latest rates of N (this is why it's called a Query Top - N ).

  • URL remote does not work from as3 html embed code

    Hello

    I'm working on a flash currency conversion application, for this purpose I go get the latest rates of exchange of yahoo,

    I am using flash cs5 and as3, I get the desired response from yahoo when I run the Flash cs5 flash file (ctrl + enter) and also after the publication (F12) by opening the html file just created by flash cs5.

    BUT

    When I move the html file and swf on a web server (WAMP in my case), the response of yahoo no longer works for me, I checked the two localhost and on the remote server.

    What can be the problem? It seems so strange to me...

    any quick and positive response in this regard will be highly appreciated.

    Kind regards
    Maani...

    It's THEIR crossdomain.xml (shown in my previous post) that is important. In other words, yahoo control it - not you.

  • heart rate alarm

    My quest for this question has resulted in answers for original 2015 watch/OS so I wanted to ask you again see if something has changed with the new series 2 and the latest OS.

    I'm looking for an alarm function on the Apple Watch who notify me if my heart rate exceeds a certain level.  This could be from the BONE, or a 3rd party application that runs on the watch (and he can't function without my phone).  It looks like such a feature useful for physical training and medical emergencies that I would not be surprised that someone has not implemented it. but my research has not given anything whatsoever.

    Hello

    Heart rate alerts are not currently available as built-in iOS or watch OS feature.

    Also note that Apple Watch, heart rate sensor and the apps included Apple Watch are not medical devices and are intended solely for purposes of fitness. They are not designed or intended to be used in the diagnosis of disease or other conditions, or to cure, mitigation, treatment or prevention of the disease.

    You can find the application third-party following (for example) of interest:

    • HeartWatch
      • The developer recommends:
        • "NOTICE: you can set up notifications for the following scenarios: what heart rate exceeds a value of bpm, when heart rate is less than a value bpm."
        • "NOTE: because your health is encrypted, store iPhone notifications only available when your iPhone is unlocked." This occurs in the background when you use your iPhone in an unlocked condition for any purpose, so in practice, you will be alerted as long as you regularly use your iPhone. »
      • https://iTunes.Apple.com/us/app/heartwatch.-view-get-notified/id1062745479?Mt=8
      • http://heartwatch.tantsissa.com/home

    More info (not a medical device):

    https://help.Apple.com/watch/#/apdcf2ff54e9

  • Slow rate of AirPlay

    I use AirPlay to get streaming football online (from the Australia, is not available outside the internet streaming via browser) my MacBook Pro (via the wifi of 5 MHz) to my Apple TV and then (via HDMI) to my TV big screen. When the action on screen is fast (i.e. 90% + screen redesigned between the ribs), it becomes very bad on the TV due to the loss of images: according to my estimate, it falls to 3 images per second. The frame rate video of MacBook Pro is much better and watchable, is not a streaming problem, but a problem of airtime. I'm using the latest Mac OS, not sure of the Apple TV. How can I improve the frequency of images on the big screen?

    1. Restart the Apple TV (settings > general > restart).
    2. Restart the Apple TV by removing ALL cables for 30 seconds.
    3. Restart your router. (Also try to remove the power cord for at least 30 seconds)
    4. Restart your computer.

    If you're still having problems, try disabling bluetooth, if it is enabled, also try to use 802.11n for wifi if you are currently using 802. 11B or 802. 11 g. You can also try to remove any other software associated with the screen sharing or streaming to remote screens that you may have installed at one time.

    In addition, the following article can help you.

    Troubleshooting AirPlay

    Troubleshooting connections and Wi - Fi networks

    Recommended Wi - Fi settings

    WiFi Diagnostic Software (for Mac users)

    You will also find help on this page, where I have collected some of the more unusual solutions for network problems.

  • The latest version of iMovie supports 30 frames per second?

    I tried creating a simple slide show, but could not find a way to make 30 frames per second, with 60 being the default and automatic.

    Although it was several months ago but I remember not being able to find a way to select the 30 images (if this option was available at all).

    So my question is: how to make a slide show and make it to 30? I choose my desired pace at the beginning or at the end? Can I do it at all?

    And Yes, I use the latest version of iMovie .

    Yes, the latest version of iMovie supports 30 frames per second.   You set the frame rate by adding a 30 fps known as the first video clip vid that you place in the timeline of your movie project.  After you have added your other pictures/clips, you can remove the first clip if you wish.  The project will have already been set at 30 frames per second.

  • Fake Apple Watch heart rate data

    I noticed something very weird with my Apple Watch. I stopped wearing for 2 weeks and during that time, I allowed the battery on the Apple Watch battery elapse. After the week 2 period I rebooted my Apple Watch again and noticed in the health App on my iPhone, the Apple Watch was started by sending dummy data of heart rate for the period of 2 weeks of time my Apple Watch is absent.

    Then I noticed after a few days when I wore my Apple Watch in the night he continued to send fictitious data of heart rate.

    The only way I could solve this problem was restoring the latest backup watch.

    Everyone knows this?

    I have the 42mm so curious sport model.

    Thank you

    Hello

    I did not personally this experience with my watch (sport 38mm watch OS 2.2).

    However, I may be able to provide a little insight into the question:

    Apple Watch knows when it is connected to its charger and will not trigger the sensor even if prompted, it seems more likely to me that one-third of the app is written to your healthy heart rate data.

    To check, go to the health > Sources and listed under 'Apps' there should appear a list of allowed applications to interact with and write data.

    You can check that these applications are not write data.

    All the best and by all means keep me updated!

    < published by host >

  • The game 9Dragons crashes so I need the latest drivers

    Hello

    I'm new to this forum.
    Currently, I am looking for a newer Nvidia display driver for my Satellite M40 (model No.: PSM40A).
    Unfortunately, the Australia Media Download (http://www.toshiba.com.au/) site content only drivers of 4 years.
    I managed to download 2 years (http://www.softpedia.com/) drivers, but this 2yrs drivers is still not helping me run the Net game (9Dragons). The laptop crashes after 10-15 minutes in the game.

    I contacted the support of 9Dragons and the ask contact me the laptop for the last display & audio drivers.

    Here are my details current drivers:
    ---------------
    Display devices
    ---------------
    Card name: NVIDIA GeForce Go 6600
    Manufacturer: NVIDIA
    Track type: GeForce Go 6600
    DAC type: Integrated RAMDAC
    The device key: Enum\PCI\VEN_10DE & DEV_0148 & SUBSYS_FF101179 & REV_A2
    Display memory: 128.0 MB
    Current mode: 1024 x 768 (32 bit) (60 Hz)
    : Default monitor
    Monitor Max RES:
    Driver name: nv4_disp.dll
    Driver version: 6.14.0011.5655 (English)
    The DDI Version: 9 (or higher)
    Driver attributes: Final retail
    Driver Date/size: 24/08/2007 09:15, 5741184 bytes
    Would be WHQL logo: Yes
    WHQL Date stamp: n/a
    VDD: n/a
    Mini VDD: nv4_mini.sys
    Mini VDD Date: 24/08/2007-09:15, 6844864 bytes
    The instrument identifier: {D7B71E3E-4208-11CF-DE64-1BDF03C2CB35}
    Vendor ID: 0x10DE
    Device ID: 0 x 0148
    SubSys ID: 0xFF101179
    Revision ID: 0x00A2
    Revision ID: 0x00A2
    -------------
    Sound Devices
    -------------
    Description: SoundMAX Digital Audio
    Default audio playback: Yes
    Default voice playback: Yes
    Hardware ID: PCI VEN_8086 & DEV_266E & SUBSYS_FF101179 & REV_04
    Manufacturer ID: 65535
    Product ID: 65535
    Type: WDM
    Driver name: smwdm.sys
    Driver version: 5.12.0001.5240 (English)
    Driver attributes: Final retail
    Would be WHQL logo: Yes
    Date and size: 09/02/2004 07:17:46, 259648 bytes
    Other files:
    Driver provider: Analog Devices
    HW Accel level: full
    Cap flags: 0xB5B
    Min/Max sample rate: 8000, 48000
    Mix beef static/Strm HW: 1, 0
    Static/Strm HW 3D steers: 0, 0
    HW memory: 0
    Management of the voice: No.
    Listen/Src/EAX (TM) 2.0: No, no
    Listen/Src/I3DL2 (TM): No, no
    Sensaura (TM) ZoomFX (tm): No.
    Registry: OK
    Sound Test result: does not work

    > The laptop crashes after 10-15 minutes in the game.
    Are you sure that the display driver is the reason for this?
    And what do you think average or it crashes? East - the laptop completely freezes or just the game?

    I never heard of the game 9Dragons but searching the site of the factory for an update or patch.

    You have installed the latest audio driver you can find on the Toshiba site?
    What's your Windows up-to-date with all Service Packs and patches?

  • Rates for calls to the Canada

    Rates for calls to the Canada Skype is 1.7 ¢ / minute + conection expenses is 3.6 cents. I called just 20 seconds and my account deletes 0.5 EUR I donts understand. I tried 2 times, one time call to the fixed phone, other phone, mobile. The same situation. I don't want to call because I don't understand, how much I pay to this topic!

    Hello and welcome to the Skype community.
    Cost of call Skype are per minute or fraction of rounding to the full minute.

    TIME ZONE - US EAST. LOCATION - PHILADELPHIA, PA, USA.

    I recommend that you always run the latest version of Skype: Windows & Mac

    If my advice helped to solve your problem, please mark it as a solution to help others.
    Please note that I usually do not respond to unsolicited private Messages. Thank you.

  • Satellite A300 PSAGCE: rate of window and perfomance has fallen since Win 7 64 bit site amenities

    Hello!

    I have a satellite A300 Model - PSAGCE and since I have instaled win7 64, my win rate dropped to 4.0!

    I used to have win vista 32 with a rate of 5.5, since I went on the site of toshiba and downloaded the latest drivers to the machine and since that I instaled the ATI driver, the rate declined to 3.9!

    How can I upgrade my laptop performance?
    Or what should I do?

    My rates are:

    Processor: 6.0
    RAM: 6.0
    Aero graphics: 3.9
    Games graphics: 5.5
    Hard disk 5.3

    Sorry my bad English...

    You have a serious problem with your laptop?

  • Heart rate reduced by half during the workout

    Hi all

    I could not find satisfactory answers to this problem, so I thought I'd post my own question. My apologies if someone has already replied.

    In 'Other' training (weight lifting), I find measures watch my heartbeat correctly for about 10-15 minutes, then, for another 3-5 minutes, my heart rate is reduced by half, or worse.

    After 3-5 minutes, the watch starts recording, which I assume to be the correct heart rate again.

    I can't find a pattern, other that happens almost in the middle of my 30-minute workout. My heart rate is measured in the range of 140-170, then it comes down to 50-70 and then back to 140-170 until I finished.

    It is a Sport of 42mm watch. I wear the sports Strip properly, no tattoos and I even shaved off part of my forearm to make sure.

    Any suggestions? Should I get the replaced watch? Perform a factory reset? Make a small sacrifice to the gods Apple Watch?

    Thank you!

    Hi Richard

    Several factors can influence the performance of the detector of heart rate, but it is expected that the sensor will give better results for workouts that involve rhythmic movements (e.g. running) rather irregular activity, such as lifting weights.

    Make sure you wear your watch fits on top of your wrist (Apple suggests consider you the clamping Strip before starting a workout and it loosen again subsequently). When weight lifting, it can also help to wear your shows a little further to the top of your arm (away from your wrist in flexion).

    It won't hurt (although it can't help, given the nature of the training) to also try restarting your iPhone and your watch:

    -Switch off the whole appliance, then restart your iPhone first.

    -To switch off your watch: press and hold the button side until you see the cursor off the power; slide it to turn off;

    -To switch on: press and hold the side button until you see the Apple logo.

    Also, check that your iPhone and the watch are updated with the latest version of the software:

    - Update the iOS on your iPhone, iPad or iPod touch - Apple Support software

    - Update the software on your Apple Watch - Apple Support

    If you are still experiencing inconsistent results, consider a matching external monitor / Bluetooth chest strap for your watch.

    More information:

    Your heart rate. What it means, and where on Apple Watch you will find. -Apple Support

    Use the Bluetooth with your Apple Watch - Apple Support Accessories

  • can I call from sri lanka to the US and what are the rates

    I take my computer with me so I can call usa Sri lanka and what are the rates

    Beachbum wrote:

    I take my computer with me so I can call usa Sri lanka and what are the rates

    With Skype, your location is unimportant. Calls to (or within) the United States wherever you are cost 2.3 cents / minute or part of it.

    You can easily find the information yourself with a little research here:

    http://www.Skype.com/intl/en-us/prices/PAYG-rates/

    TIME ZONE - US EAST. LOCATION - PHILADELPHIA, PA, USA.

    I recommend that you always run the latest version of Skype: Windows & Mac

    If my advice helped to solve your problem, please mark it as a solution to help others.
    Please note that I usually do not respond to unsolicited private Messages. Thank you.

  • Dynadock can only display 1280 x 1024 at 60 Hz refresh rate

    Hello.

    I just installed my dynadock (VGA).
    I run Vista Home Premium.
    I've set up three screens:

    (1) the laptop;
    (2) VGA monitor connected to the laptop.
    (3) VGA monitor connected to dynadock.

    I downloaded the latest drivers dynadock from Toshiba Web site and installed.
    Everything works until my office two additional monitors...

    ... except that when I put in display the Dynadock to 1280 x 1024 at true color (32 bit), the best refresh rate, it will allow me is 60 Hz.

    The laptop is Toshiba Satellite P205D-S6454.
    The two monitors are two 19 "109P 40
    The display through a SV221DD Starview KVM switch.

    I also downloaded and tried the latest drivers from Displaylink (which seems the graphics card in the Dynadock and has some newer drivers than what is included in the latest Dynadock drivers) with the same results.

    Is this normal, or should it be able to give me better than 60 hz to 1280x1024x32bpp?

    Thank you

    Sean

    Hello

    I checked the specs on this site and it seems like the dynadock is only capable of displaying 1280 x 1024 32 bit 60 Hz max.

    Here´s the link:

    http://www.toshibadirect.com/TD/B2C/content.to?page=dynadock

    See you soon

  • How to change LCD on my Satellite A200-13R screen refresh rate?

    I really need your help guys, I bought the Satellite A200-13R, it has only 60 Hz refresh rate option, refresh rate of 60 Hz hurt my eyes and make me feel their combustion, 85 hz frequency never make me feel like, it's more comfortable for my eyes, but 85 Hz is not available in this satellite A200-13R is the graphics card Mobile Intel® 945GM Express Chipset

    I installed the latest drivers 4 this graphics... but still only 60 Hz option refresh rates available

    each of you know how 2 have 85 Hz refresh rate 2 use in this model

    I would be gratfull to have your help and I am glad 2 hove, some of you as a friend.

    Hello, my friend

    At first I try to understand your nickname, but unfortunately without success. Is there maybe a hidden message? ;)

    In any case, your ad is really amazing. LCD technology is truly the best for the eyes and the content is illustrated flicker. The old monitors refresh rate of 60 Hz was quite low and result flickered photo. Higher discount rates using the image was stilly and flicker.

    LCD technology is different and standard setting is 60 Hz. In my opinion you should speak with your family doctor. Maybe you need glasses when working on PC. I have some colleagues in my office who use glasses when working on PC.

    Bye and good luck!

  • Bad screen refresh rate shown under Vista - Satellite P100-429

    Hello

    I have a Satellite P100-429. There are three weak, I install Windows Vista Ultimate Edition, but now the highest of screen refresh rate is 60 Hz. I tried to download the latest drivers for the graphics card, but this will not work and the computer also says that the monitor is called generic PNP.

    Before Vista has a 100 Hz screen refresh rate and monitor had his screen Toshiba TruBrite WXGA + TFT of own name I tried looking for drivers for the monitor but without success, someone can help me pretty please, I get headaches for the low screen refresh rate.

    Hello

    Have you installed the right graphics card driver?
    Immediately after installation of Vista, the operating system uses Microsoft's own common graphics driver.
    If you want to use additional graphics options, you need to install the compatible graphics card driver.

    But I want to clarify something. The LCD or TFT screens give excellent quality and resolution at 60 Hz.
    the Refresh on TFT rate simply won't say the same thing about monitors CRT.
    Response time, brightness of the Image and the contrast of the Image are more important for a TFT or LCD monitor like the refresh rate.

    Performance display and the quality isn't worst if it run on 60 Hz
    Therefore, I see no reason to change the refresh rate of 100 Hz

Maybe you are looking for