Need to null values with the values of filling the date before weekend/holidays

I have a table with a Date column, column Type and rate column.

The problem is when the weekends and holidays, column Type and rate column are null.

I need all null values with the values of Type and fill rate before that date is the weekend and public holidays.

Example:

I have:

RATE OF TYPE DATE
07/01/2010 4510 PM 3.71
07/01/2010 CETE28 4.59
07/01/2010 TIIE28 4.95
07/02/2010 4510 PM 3.82
07/02/2010 CETE28 4.63
07/02/2010 TIIE28 5.11
* NULL NULL 07/03/2010 *.
* NULL NULL 07/04/2010 *.
07/05/2010 4510 PM 3.91
07/05/2010 CETE28 4.74
07/05/2010 TIIE28 5.25

Will be:

RATE OF TYPE DATE
07/01/2010 4510 PM 3.71
07/01/2010 CETE28 4.59
07/01/2010 TIIE28 4.95
07/02/2010 4510 PM 3.82
07/02/2010 CETE28 4.63
07/02/2010 TIIE28 5.11
* 07/03/2010 4510 PM 3.82*
* 07/03/2010 CETE28 4.63*
* 07/03/2010 TIIE28 5.11*
* 07/04/2010 4510 PM 3.82*
* 07/04/2010 CETE28 4.63*
* 07/04/2010 TIIE28 5.11*
07/05/2010 4510 PM 3.91
07/05/2010 CETE28 4.74
07/05/2010 TIIE28 5.25

What could I do?

Hello

You can use the analytic LAST_VALUE function to get the last day of work before each date into your table. It will be the same as the current day for every day of work.
Do it a self-join to combine each current line (c) with the last day of work (l):

WITH     got_last_work_day     AS
(
     SELECT     dt, type, rate
     ,     LAST_VALUE ( CASE
                    WHEN  type  IS NOT NULL
                    THEN  dt
                   END
                   IGNORE NULLS
                  ) OVER (ORDER BY dt)     AS last_work_day
     FROM     table_x
)
SELECT       c.dt, l.type, l.rate
FROM       got_last_work_day     c
JOIN       got_last_work_day     l  ON       (    c.dt          = l.dt
                         AND  c.type          = l.type
                         )
                       OR     (    c.last_work_day     = l.dt
                         AND  c.type          IS NULL
                         )
ORDER BY  c.dt
,       l.type
;

Among other things, I guess that the type is NULL if (and only if) the line represents a holiday or weekend, and that the combination (dt, type) is uniuqe.

Tags: Database

Similar Questions

  • Need Windows XP Prof. with the German language

    Dear friends,.
    I have my laptop in Holland bought.
    My Labtop Windows language is English, but I need Windows XP Prof. with the German language.
    How can I install the new Version of Windows in my Labtop?
    Do I have to buy a German version of Win XP Prof?

    Hello

    I suppose that you bought your laptop in the Netherlands.
    Unfortunately, you need a German original version of Win XP.
    After new Win XP installation, you can download ad install all necessary Toshiba drivers from the Toshiba download or the tools & utility cd page.

    Good bye

  • My original XP Pro disc is SP2. I've updated to SP3 and now I have corrupted files and need to repair windows with the disc.

    My original XP Pro disc is SP2. I've updated to SP3 and now I have corrupted files and need to repair windows with the disc. When I put disc SP2 in it tells me that it is a work old version and custom. How to make a disc with SP3 top to repair my OS?

    Hi DFPI.

    I suggest you to uninstall Service Pack 3 temporarily on your computer.

    How to remove Windows XP Service Pack 3 from your computer

    Later, try to repair the computer with the Windows XP disc and check if it works.

    Later, reinstall the Service Pack 3 after the computer repair.

    Reference: Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe)

    Hope the helps of information.

    Please post back and we do know.

  • Need help - Cisco ASA with the power of fire

    Hello

    Currently, we use asa 5510 without function of firepower. Our goal is to publish web servers and microsoft lync with reverse proxy method. control internet traffic, apply extensions individual file not to download, management of bandwidth etc.

    Is it possible if we add firepower on asa 5510... Please guide me... Thank you

    Power of fire must be installed on the new series X of the SAA.  5512 x, x 5515, 5525 x, etc.

    If you have a 5510, you probably want a 5512 x with an SSD.  Cisco has beams of firepower include the ASAx with SSD and the license of firepower.

    Adds that you must also Firesight management software, and there is a license bundle of 2 camera for under $ 500 that you can install on VMWare.

    Firepower is not reverse proxy, it's transparent online packages, analysis and filtering by URL / Application / and threat mitigation.

    If you want a reverse proxy, you should look into Microsoft ISA server or a Proxy Server reverse dedicated Web.  Cisco gave its product Web Director, who has done this function.

    You can host Web sites behind a firewall of ASA without proxy reverse.  And the ASA has an inspection of the request for HTTP traffic, responsible for watching HTTP requests.  The firepower to the ASA system also has specific signatures that monitor traffic to the web servers and prevent specific vulnerabilities that are known on those servers, so if that is what you want the Reverse Proxy for, then the power of fire module would probably cover your needs.

    Don't forget that until the next quarter firepower system has no decryption on the box, and you might want to wait that the feature is released and put in place, so that you know what size firewall you need protect your network with the SSL decryption.  I believe that the ASA5512x is testing at 75 Mbps stream decrypted via the fire power module, which is about half of what was before CX, then you could use the sizing numbers CX and extrapolate until Cisco releases official decryption numbers.

  • Need help with the data storage store, local array and network connections

    Need help with my ESXi 4.1 installation

    My hardware:

    I built a server with an Asus P6T whitebox, i7 920, 12 Gig RAM, NIC, Intel Pro1000 PT Quad, 3ware 9650SE-12ML with 8 1.5 TB SATA green in a raid 6 array gives me about 8 + TB with a spare drive all housed within a NORCO RPC-4220 4U Rackmount Server chassis.  I also have a 500 GB SATA drive which will hold the ESXi and virtual machines.

    The network includes a firewall, Netgear Prosafe FVS336G, GS724Tv of Netgear ProSafe 24 port Gigabit Managed Switch on a dhcp cable modem internet service provider.

    I also have 2 old NetGear SC101T NAS disks (4to) I want to connect to the system how some - at a later date have... data on them and want to transfer to the new storage array. I always looking into the question of whether they will work with ESXi 4.1, or I might have to only access it through Windows XP.

    My Situation:

    I have already installed ESXi 4.1 and vsphere client with no problems and it is connected to a dhcp cable internet service.  I've set up host via a dynamic DNS service name give me a static hostname on the internet.  I installed three machines to virtual OS successfully at the moment and now want to first start by creating a multimedia storage server which will use some of this new 8 TB array, then separate data storage for use with a web server small overhead storage and a backup.  It is a domestic installation.

    Help with the data store and network:

    I was doing some reading, because I'm new to this, and it looks like I'll probably want to set up my table via ESXi as a nfs disk format.  Now, the data store is usually in another physical box from what I understand, but I put my readers and ESXi all in the same box.  I'm not sure that the best way to put in place with grouped network cards, but I want to make this work.

    I understand that in ESXi 4.1 using iSCSi LUN must be less than 2 TB, but nfs - I should be able to add a bigger partition then 2 TB (for my multimedia) in nfs, right? or should I still add it separately as a separate 2 TB drives and then extend them to get the biggest space.

    Any suggestions or direct resources showing examples on how to actually add some parts of the table as data warehouses separate nfs.  I know that to go to the configuration tab, and then select Add to storage, and then select nfs. I have not my picture, but it's here that I don't know what to do because ESXi 4.1 system already has an address, should I put the same thing to the new data store array also (will it work?), and what should I use for the name of the folder and the store of data... just do something to the top.  I thought to later install Openfiler (for a multimedia storage using this table server) as a virtual machine, use the table with esxi so that I can access the same storage space with widows and linux-based systems.

    I also know I have to find a way to better use my quad nic card... put in place of virtual switches, grouping, etc HELP?

    Any direction, assistance, similar facilities to sample, suggestions or resources that would help would be great. I did a lot of hunting, but still a little confused on how to best to put in place.

    You must think of VMDK files of large databases with records of random size guest go read some data (a DLL or an INI file), maybe write some data back, then go read other data. Some files are tiny, but certain DLLs are several megabytes. It's random i/o all and heavy on the search time. IO Opsys is small random operations that are often sequential (go read data, write data, go read other data,...) so that deadlines are critical to the overall performance. That's why people say OPS are / s of reference and forget the MBs flow. The only time where you bulk transfers are when you read media (ISO files).

    Well, now forget all this. Actually the disk activity will depend on the specific applications (database? mail server? machines compiler?), but the above is true for boots, and whenever applications are idle. You should see the profile to know.

    RAID 10 is faster (and often more reliable) than RAID 5 or RAID-6 except in certain specific cases. In General RAID 10 is ideal for many random writes, since the calculation of parity for RAID-5 and - 6 adds to the overall latency between command and response - latency is cumulative if a little slow here and a little slow it adds up to a lot of overall slow synchronous especially with e/s on a network. OTOH RAID-5 and -6 can produce faster readings due to the number of heads, so you can use it for virtual machines that transfer bulk. Test. You may find that you need several different types subdashboards for best results.

    You said 3ware, they have some good grades on their site, but don't believe it. With my 9650 that I found myself with only a couple of their recommendations-, I put the (simple) table for allocation size 256 k, nr_requests at 2 x the queue_depth and use the planner date limit. I had the habit for the Ext4 file system formatted with stride and stripe-width synced to the table and used the options large_files with fewer inodes (do not use the huge_files option unless you plan to have single VMDK files in the terabyte range). Use a cache of great reading in advance.

    Virtual machines use VMDK files in all cases except raw iSCSI LUN that they treat native disks. VMDK is easier to manage - you can make a backup by copying the file, you can move it to a PC and load it into another flavour of VMware, etc. There could be some features iSCSI to your San as a transparent migration but nothing for me. NFS has less chatter of Protocol if latency lower times to complete an operation. NFS is good to read and write a block of data, that's all it boils down to.

    UPS is good, but it won't help if something inside the machine explodes (UPS does nothing if the PC power supply goes down). If the RAID card has an option for a battery backup module, so it can contain some writings in memory and may end up the disk i/o after replacing the power supply. 3ware also limits the types of caching available if help is not installed, and you get just the right numbers with the module.

  • How to make a list of question field with the data type DATE?

    I have a column with the DATE data type. Using forms 6i I want to generate a poplist field of list item with this column while the value of the items in the list of names of days like SATURDAY, SUNDAY, MONDAY. If we change the date to a char data type, it won't work properly, but now with the data type DATE behind him, it gives the following error message

    "FRM-32082: invalid value for given the type of element."
    List WEEKREST
    Article: WEEKREST
    Block: EMPRESTS
    Form: module 3
    FRM-30085: unable to adapt to the shape for the release. »


    Using forms 6i how a list item field type DATE data which may contain names of days?

    Set your date as a hidden field (not shown) column. Create your item list with the names of day of varchar2. Create the list item as a base table field that accepts the values of text in the names of the days. On this area, create a when-validate-item trigger that translated the text into an actual date that it then uses to set the value of the real object of the base table.

  • How to get to 'leave the event' script to run again when the form with the data file is reopened?

    I've created an Adobe Dynamic XML using LiveCycle Designer form with many fields / subforms that are 'visible' or the 'hidden' according to the selected options of different menu drop-down lists. Also, the form has been activated to save. Users can successfully fill out the form and save a copy with the data that has been entered.

    The problem I have is that when the recorded file is opened again in the 'hidden' fields / subforms that were previously made visible by selecting the appropriate options in the drop-down list NOT displayed now. However if you make the same selections from each of the drop-down list shows still hidden ONCE the fields / subforms are displayed, and do not contain data that has been entered.

    The problem seems to be that the script that determines whether a field / subform is 'hidden' or 'visible' is a

    "<event activity="output" name="event__exit">" "

    that is followed by

    If (this.rawValue is '0')- (i.e. the value of the drop-down list)

    sfCompanyDetails.presence = "visible";

    sfRecruitmentAgency.presence = 'hidden ';

    etc, etc.

    and, therefore, it is not executed again when the file is reopened.

    Can someone advise please how do I do this?

    Hello

    Check if you enabled the "auto" option to keep the script changes in the properties of the form.

  • JavaScript works well with the date picker

    I tried onchange and onblur javascript events in the field of the HTML Form element...
    they work great with text fields... but not with the date picker...
    It seems after that date is selected, javascript is triggered, but set to get pulls the value of the field before the date chosen in the selector is placed here...

    is it possible to get the event fires with the value of dates...

    Hello

    Check your sample now.
    I have put your function setStatus page JavaScript and Execute when the Page loads

     $('#P1_DATE_FINISH').datepicker("option",{
      onClose:function(t,i){setStatus()}
     });
    
     $('#P1_DATE_START').datepicker("option",{
      onClose:function(t,i){setStatus()}
     });
    

    You can also replace this with

    $.datepicker.setDefaults({onClose:function(t,i){setStatus()}})
    

    Kind regards
    Jari

    Published by: jarola December 14, 2010 16:28

    You probably like to have event onchange in the text field, so I change to

    $('#P1_DATE_START,#P1_DATE_FINISH').datepicker("option",{
     onClose:function(t,i){setStatus()}
    }).change(function(){setStatus()});
    
  • problems with the date picker

    I found some problems with the date picker to make my first presentation of object BPM.

    I created a group with a datetimestamp it contains. When I click on it in run mode, it will bring a new tab in the browser. This behavior is different from that of a date picker outside a group where there just a small javascript popup.

    Anyway around this problem?

    Also, would be nice if could be set by default to the current date. is there a way to who?

    For the component "time" it seems impossible to define the default value - at least on the tab object structure.

    Thank you

    Try to set the property "DHTML" to control date Yes. This option is under the Properties tab-> the calendar section. This will force it to use the popup javascript on screen instead of opening a new browser window/tab.

    To set a default value for a date/time, you can simply set the value in the constructor of the BPM object in which the property is located.

  • Problems with the date in the procedure on Oracle 11 g

    Hi gurus,

    I have some problems with the date under Oracle 11 g format.

    Let me explain the situation:

    When I start such a request
    Select to_number (to_char (to_date('01.04.2009','dd.mm.yyyy'), 'yyyy'))
    of sys.dual

    I had as a result 2009 under the number.

    When I do the same thing in a procedure of a package like this

    my_year: = to_number (to_char (to_date('01.04.2009','dd.mm.yyyy'), 'yyyy'));

    the my_year variable contains the value 9 instead of 2009.

    Can someone explain to me what goes wrong?

    I just tested with the evolution of the variable nls_date_format of environment for the session and the database is complete without success.

    Kind regards
    Björn

    Yes, it has everything to do with your environment settings.

    SQL> set serveroutput on;
    SQL>
    SQL> declare
      2    my_date date;
      3    my_zeitstempel varchar2(32767);
      4    my_tageswechsel float;
      5  begin
      6    my_zeitstempel := '01.03.1998 07:00';
      7    my_tageswechsel := .25;
      8    my_date := to_date (substr (my_zeitstempel, 1, 10), 'dd.mm.yyyy') + my_tageswechsel +1/24;
      9    dbms_output.put_line( my_date);
     10  end;
     11  /
    01-MAR-98
    
    PL/SQL procedure successfully completed.
    
    SQL> alter session set nls_date_format = 'dd.mm.yyyy hh24:mi:ss'
      2  /
    
    Session altered.
    
    SQL> declare
      2    my_date date;
      3    my_zeitstempel varchar2(32767);
      4    my_tageswechsel float;
      5  begin
      6    my_zeitstempel := '01.03.1998 07:00';
      7    my_tageswechsel := .25;
      8    my_date := to_date (substr (my_zeitstempel, 1, 10), 'dd.mm.yyyy') + my_tageswechsel +1/24;
      9    dbms_output.put_line( my_date);
     10  end;
     11  /
    01.03.1998 07:00:00
    
    PL/SQL procedure successfully completed.
    
  • Print an e-mail with the date of the transmission

    Hi, I need to print an email I wrote to send as proof, but when I do that it shows the date of printing, NOT the date it was originally mailed. Is there a way to fix this? I hope that you can help us as soon as POSSIBLE! Thank you, Annie.

    anniesol said

    Hi, I need to print an email I wrote to send as proof, but when I do that it shows the date of printing, NOT the date it was originally mailed. Is there a way to fix this? I hope that you can help us as soon as POSSIBLE! Thank you, Annie.

    Problem is now solved! Choose the print option 'other measures' dropdown list allows email to be printed with the date of the shipment.

  • problem with the data record

    Hi, I'm new to LabView so I know that the thing I'm doing is relatively easy, however, I'm stuck.

    I made a small program that gets 5 steps (for now replaced with random numbers) and as well as the date and time data in the text file. I intend to run the program for long periods of time, so I want to increment the file name/path every hour, but after the addition of this part of the program does not create any file, although the program runs without error.

    Block diagram is attached, could someone point out to me what is wrong and what I should do to reach my goal?

    Thanks in advance!

    Hi marcis,.

    Acually, the logic of the program was completely wrong.

    1. your comments the file path will never help you. Because after leaving of while loop, the structure of matter will run once and LV will stops running.

    2. open and close the datalog only once file. Try to make all your manipulations between opening and closing your file datalog. Otherwise, it will be difficult to manage when you develop your code.

    3 case construction outside the loop is meaning less. If you want to run the program permanently, place all functions inside the while loop you want to run. While the loop will run continuously until you get satisfied.

    4. incorrect data streams. All programmers need well with the data stream.

    Just go into the basics of labview here and try to realize your logic again

  • Problems with the date and time - have to reset the date & time on reboot

    original title: problems with the date and time

    Whenever I turn on my computer (Windows XP 2002) I click on F2.  Then I re - set the date and time it occurred in January 2006 1 h every time I have turn off the computer.  Can someone tell me what I need to do?

    You need to replace the battery in time clock (RTC) real of your computer.  It can also be called the CMOS or BIOS battery.

    Many computers, this battery is an inexpensive CR2032 button available in almost every pharmacy corner.  There are, however, some computers (especially laptops) that require a different (and probably more expensive) battery.

    Whatever the expense, almost all of these batteries are easy to replace.

    To get help, post back with the brand and model of your computer.

  • Problems with the data connection

    Hello
    I bought a Z3 Compact Xperia on December 10, 2014. I live in Italy and I use Vodafone as my everyday.
    I got a SIM card replacement nano with LtE capabilities just to get the phone in the new fast network. The problem I encounter is that, since on January 13, 2015, I had some problems with the data in mode 3 G connection.
    So far, I used my phone normally, then I tried to send a text message with WhatsApp and phone stuck with the clock icon in the lower corner of the bubble of the message. I thought it was a temporary network problem but I'm not sure about this.
    I live in a small town where the coverage is really good, either in 3G and LTE. I tend to use the 3G because it uses less battery and it does not affect my 4G data plan.
    Th issue, it's that if I do a speedtest when I feel that network glitch I have a ping, but with very good download speeds up to 2000ms.
    The problem is that I believe that this is not a network problem because my mother has a phone HtC One S and runs vodafone without problem even when I'm having the glitch.
    I tried to reset the phone to factory settings, but it did not help.
    In LTE / 4G I do not experience this issue. In fact, I think if there is problem need a phone related software because the antenna works very well.
    If it doesn't I'll try to contact ad Vodsfone then I'll send my phone for the helpdesk if Vodafone tell me that the question is not on their network.

    Thanks in advance for your help.
    Simone

    It's pretty strange, double check the APN settings and contact EE in this regard.

  • What happens with the data on ROW as soon as they are storage migrated to VMDK?

    Hi all

    The following scenario: I have a virtual machine with virtual RDM. I have storage migration online, selection of thick discs so convert the VMDK RDM. The question is: what is actually happening with the data on the LUN that was RDMs, once the migration is complete?

    I expect that the data are still there, and if needed, I can remove the VMDK and re - attach the new LUNS as RDM.. But I can't find any official information on this.

    I am not mistaken? Y at - there somewhere that says clearly what is happening with the data?

    Thank you!

    Your wait is quite correct. The data on the raw LUN will not get affected once it is converted to a virtual machine. Only the mapping of RDM file is deleted and the LUN becomes available, and you can use card or again as an RDM or to create a VMFS data on that store.

    André

Maybe you are looking for