Need help to compare data

Hi gurus

Need your help again. I create 2 folders and my scenario is that band 100a package 3 type 2 EPC and 1 HEAL and I compare each EPC (package_type) Eff_date eff_date (package_type) health and maximum eff_date back...

Table

Select 100 GROUP_NUMBER, to_date('01-JAN-13') EFF_DATE, PACKAGE_TYPE 'EPC' FROM DUAL

UNION ALL

SELECT 100, to_date('01-MAR-13') EFF_DATE, 'EPC' FROM DUAL

UNION ALL

SELECT 100, to_date('01-FEB-13') EFF_DATE, 'CURE' OF the DOUBLE

;

Output

GROUP_NUMBER EFF_DATE PACKAGE_TYPE

100                                '01-FEB-13'                EPC

100                                ''01-MAR-13''              EPC

Rules

If you see my original data then 1st EPC Eff_Date compare with 3 rows Eff_date and maximum return date

If you see my original data then 2nd EPC Eff_Date compare with 3 rows Eff_date and maximum return date

No need to compare package_type_code being package_type HEAL HEAL only to use for comparison.

Thanks in advance

Concerning

Shu

You can do this for the data provided. If the value of "HEAL" is several lines in the table? So what effective date, you must choose. I suppose that, in this case, you can use MAX (eff_date). You can try this.

WITH T1 AS)

Select 100 GROUP_NUMBER, to_date('01-JAN-13','DD-MON-RR') EFF_DATE, PACKAGE_TYPE 'EPC' FROM DUAL

UNION ALL

SELECT 100, to_date('01-MAR-13','DD-MON-RR') EFF_DATE, 'EPC' FROM DUAL

UNION ALL

SELECT 100, to_date('01-FEB-13','DD-MON-RR') EFF_DATE, 'CURE' FROM DUAL)

SELECT GROUP_NUMBER,

CASE WHEN (EFF_DATE > (SELECT MAX (EFF_DATE) FROM T1)

WHERE PACKAGE_TYPE = 'CURE'))

THEN EFF_DATE

ON THE OTHER

(SELECT MAX (EFF_DATE) FROM T1

WHERE PACKAGE_TYPE = 'CURE')

END AS EFF_DATE,

PACKAGE_TYPE

FROM T1

WHERE PACKAGE_TYPE! = 'HEAL '.

OUTPUT:

GROUP_NUMBER EFF_DATE PACK

------------ --------- ----

100 EPC 1 FEBRUARY 13

100 EPC 1 MARCH 13

Post edited by: Partha Sarathy S

Tags: Database

Similar Questions

  • Need help with the date of Validation Urgent

    Hello

    We need help in the Validation Date.

    We have 2 fields of Date on the form the Start Date, End Date

    The requirement is: End Date (cannot be more than 30 years as of the start date).

    I wrote after the script on the exit eventof the End Date . But the problem is its calculation of 30 years from the current Date not from the Start Date

    var

    tDate = util.scand (' mm/dd/yyyy', new Date());

    var

    M = tDate.getMonth ();

    var

    D = tDate.getDate ();

    var

    Y = tDate.getFullYear ();

    var

    SRes = util.printd("yyyy-mm-dd", new Date((Y+30), M,D) );

    App.Alert (SRes)

    If

    (SRes < = this.rawValue)

    {

    App.Alert ("cannot be greater than 30 years from the start date")

    () xfa.host.setFocus

    ce );

    }

    can someone help me please

    Kind regards

    Jay

    Hello

    You need to get the LCD field javascript and calculate & compare with the future date in date javascript.

    Try the following script.

    var sDate = StartDate.rawValue;
    var wkStartDate = util.scand ("yyyy-mm-dd", sDate);

    nYear var = wkStartDate.getFullYear ();
    nMonth var = wkStartDate.getMonth ();
    nJour var = wkStartDate.getDate ();

    var wkFutureDate = new Date (+ 30 nYear, nMonth, nJour);

    sDate = EndDate.rawValue;
    var wkEndDate = util.scand ("yyyy-mm-dd", sDate);

    If (wkEndDate.getTime () > wkFutureDate.getTime ()) {}
    xfa.host.messageBox ("cannot be more than 30 years from the start date");
    xfa.host.setFocus (this);
    }

  • 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.

  • need help for calculation date

    I need help with this:

    I added successfully a document level script to add the date printed in my document

    this.getField("DatePrinted").value = util.printd ("mm/dd/yy", new Date());

    I now need to fill in a field named "Date" with a date that is 14 days after the date of DatePrinted.

    and I'm lost.

    Can anyone help?

    Get the current date/time

    var d = new Date();

    Add 14 days

    d.setDate (d.getDate () + 14);

    Set a field value

    getField("Deadline").value = util.printd ("mm/dd/yy", d);

    That last part may need to be changed depending on where you place the script. If it's the same script at the document level, the whole thing can be:

    Get the current date/time

    var d = new Date();

    Set a field value

    getField("DatePrinted").value = util.printd ("mm/dd/yy", d);

    Add 14 days

    d.setDate (d.getDate () + 14);

    Set another value of field

    getField("Deadline").value = util.printd ("mm/dd/yy", d);

  • need help on filling data dynamically from list of choice while the page is loading

    Hi all

    I need to dynamically fill data in the picklist (drop-down list on the component) during the loading of the page itself, can you please a little help on this. I mean for the values of the component < f: selectItems > < af:selectOneChoice > must be filled dynamically, so that loading page. I will be grateful if you can provide examples of code.


    Thanks in advance



    Concerning
    Ashok E

    Hello

    the problem with your code is that it is not af:selectItem but f: selectItems


    *

    Frank

  • Need help with coversion date

    Hello

    I have a date format that is varchar2 and value is as on 2009-03 - 31.i need to convert to date and it must be as on 31 March 09

    I get as error 0RA-01981... Please help me in this
    SQL> select to_date('2009-03-31','yyyy-mm-dd') xc from dual ;
    
    XC
    ------------------------------
    31-MAR-09
    

    For your http://ora-01981.ora-code.com/ error

    SS

  • Need help to compare and replace

    Hi all

    I have a cumulative file that is added at the end of the month. The Table contains information about customers, like:

    customer_id, name, address, phone, notes, DATE_STAMP

    In addition, I have other Tables that are divided into monthly Tables and information for these monthly tables are obtained from this cumulative one table. When I collect the information at the end of the month (which is added to the summary table that grows in size), I put the name of the MONTH in the column DATE_STAMP. MARCH, APRIL, MAY, JUNE, etc...

    So I select all of MARCH (from the cumulative Table) and then who is put in the MARKET Table. These Tables are compared with others a month control Tables for analysis.

    The challenge is what to say in APRIL or MAY, a value important column changes in the summary table so I need to update the monthly tables to reflect this.

    Then... I will concentrate on the key columns.

    customer_id, DATE_STAMP, Sales_Person_Assigned

    In the cumulative table (which has many months), say I select all of MARCH and move customers to a MARCH_TABLE. I'll use a customer as an example:

    customer_id, DATE_STAMP, Sales_Person_Assigned
    12345, MARCH, NULL

    Then in APRIL, most data enters the cumulative file, and those who are stamped APRIL for DATE_STAMP column.

    So, when I check the client who was in MARCH, now in this file, they could be like this: (update of the record sales person)

    customer_id, DATE_STAMP, Sales_Person_Assigned
    12345, MARCH, Frank Smith

    I need a way to take the CUMULATIVE table and compare it with the corresponding MONTH_Table and update that Null for Frank Smith.

    So say what: September today and we have 9 separate Tables Jan - September and ONE cumulative Tables Jan - September, I need only a summary table to check all individual Tables and based on:

    customer_id AND DATE_STAMP - a JOIN match here and if the value is null before in the field of the Sales_Person_assigned, if is no longer null, updated as the new value of cumulative for the monthly tables.

    Any help would be appreciated, sorry if this sounds too complicated.

    user621335 wrote:
    AND (NVL (your. GTP, 'X'). = NVL (tt. GTP, 'Y');

    I know NVL is a function that will replace a value if it is NULL with X or Y. But I wanted to make sure I understand this line. Table your if value is NULL it puts an X (temporarily?) and Y for table tt temporarily?

    So if both are NULL, they will get an X and Y, then they could not equal each other. You can specify that? So that means, if they equal each other, there is no update and to what update? or am I confused?

    Sorry, my mistake - I would have had the same share values and else equal (I've corrected that now).

    If a table your or table tt has a NULL value in a column, no equality will return UNKNOWN, that is, even if we could have a value and the other NULL, it would not be picked up because NULL is the absence of a value and therefore cannot return true or false. NVL will set a value here for the purposes of the motion only, so that either TRUE or FALSE will be returned. Here, the key is that the NVL value must be a value that can never legitimately exist in the column, i.e., 'X' could never be a value in the Sales_Person_Asisgned column. If it's a numeric column, we use-1, or something just as impossible for a legitimate column value.

    If both are NULL, 'X' is equivalent to 'X', so the file will not be updated on this column, if it is NULL, 'X' will not match a legitimate value, so the record will be updated on this column.

  • Touch iPhone 5s does not not needing help for the data on it.

    iPhone 5 s (iOS 9) I have blue and red lines on the screen and the touch does not work at all, but the phone still works as usual outside the lines and contactless (voice on don't work/Siri as other items said worked, I do not have wifi for Siri). What I want is the data on the phone, I have a macbook pro (OS X 10.11) a fix would be better, but all I need is the data. I have icloud activated, but it was defective on my phone so don't know if I had a full backup and would like to know how to check. I have a form of computer backup about 2 months ago, but wanted all the pictures and data since then.

    At the back for up to my pc, I need is to unlock my phone, so any help will be appreciated.

    Thank you

    If connect to iTunes and perform a full backup

    And also connect on iCloud & see you backup recently

  • Need help to avoid data loss on a corrupt and/or failure to hard drive

    I don't know what happened. One minute I'm surfing the web and listening to music on iTunes. Then out of nowhere he had a sudden failure. Changed not long at all, but now when I try to turn on my computer, it starts normally but then shortly after that the chime and the apple logo appear, if a progress indicator yet that I've never seen before today. Until the progress bar is still the size of my little finger nail, the computer turns off just. I started in recovery mode and run disk check and repair utility. Make sure the disc is not far off when he said something like - disc cannot be checked completely. Disk needs to be repaired. So when I click on the repair disk, it works only for maybe a minute before it comes up saying - utility disk can't repair the disk. Upwards from your many possible files, reformat the drive and restore your backed up files. So obviously it's not good. What are my options and can I do to avoid losing data that is not already saved? I have a lot of things that have not been backed up and lose some of them would be pretty damning. That's my main goal; data loss as little as possible. My computer is an iMac 2012 end Mavericks 10.9.5 running.

    Thank you.

    You do not have a current backup? If this is not the case, your only real option may be to pay a data recovery company and see if they can help you. Which can be very expensive.

  • Need help to recover data from registry to update to Windows 8.1

    So I'm quite a pickle here. I need to update my computer Windows 8.1 but the installer of Windows 8.1 (app) do not like it when you have made changes to the registry.

    I'm running an SSD 128 GB as my main boot (c :)) drive
    Along with that I am running a 2 TB HDD as my main storage to store any (e)
    To make this work I had to change the locations of the registry for Program Files and Program FIles (x 86) file, so that my SSD would not fill.
    But while doing this, I've never done a backup of the original registry to restore to the.
    I really need 8.1 Windows for Visual Studio.
    Sidenote. I built this PC by myself
    Data sheet:
    Core i7 3870
    ASUS P9X79 motherboard
    EVGA GeForce GTX 670
    Boot drive for the SSD 128 GB
    Storage of 2 TB drive
    Windows 8

    (You can help hope)

    Hello

    Microsoft does not recommend changing the registry entries of Program files and the data folder drive C: as it has very high chances of failure. This is why it is not recommended to take this path, unless the changes are cancelled.

    To cancel the changes you have made, you must refer to the guide or the steps you followed to move the location of the program files and revert the changes exactly in the order given earlier.

    If you have made changes recently, you can restore the computer before changes to the registry and check if it helps.

    How to restore, refresh or reset your PC

    http://Windows.Microsoft.com/en-us/Windows-8/restore-refresh-reset-PC

    Important: System Restore will return all your files non-system as documents, email, music, etc., to a previous state. These files of types are completely affected by the restoration of the system. If it was your intention with this tool to recover a deleted file to non-system, try using a file instead of system restore recovery program.

    Hope this information helps. If you have any questions, please let us know.

  • Need help on displaying data

    Hello Experts,

    I create custom pages 3.

    Page1 (requester Details) - employee details (to be completed by the user) who raise a request

    Page2 (expense lines) - employee details for shown who had entered the first page (region1) and

    Noire2 - Advanced table to add lines and enter the details of expenses where more than one line is possible.

    Page 3 (Summary page) - Details of the employee in the first page + lines of expenditure in the second page + the textual data (approvers list) which is readonly text.

    Submit page3.

    All together in the area of train MultiPage.

    Could you please help how to create page3 (summary page) which the expenditure lines to display page 2?

    Things that will help me to design the page.

    Thanks in advance,

    Suman

    Keep AOS (Application Module) even for pages that allows you to view the details of the first page and the second page on the last page (just displaying VO instance. no need to refresh). So you can easily submit it to the end.

    Kind regards

    Stephanie.

  • Need help with vSphere data script, packaging and sending it to the data warehouse

    Greetings PowerCLI gurus.


    Everyone can offer suggestions on a script which can query vSphere and pull on the following fields of the virtual computer:

    NameStateStatusHostSpace in useSpace used

    Format in a file in the CSV format and send the file to an FTP server?

    Much respect to all, thanks a lot in advance.

    Hello-

    Happy to help you.

    OK, well, if this database is accessible through a UNC path, you might make a copy directly using Copy-Item.  If you use different credentials, you can encrypt and store in an XML file.  HAL Rottenberg wrote to do http://halr9000.com/article/531.

    Or, if this pension data is something that supports the secure copy (scp) or secure FTP (SFTP), those who would be good options.  Again, you can store the alternative credentials in an encrypted in an XML file format and use them as needed.

    Certainly, there is a balance to be struck between security and ease of use.  It may be such that the transmitted data are not considered sensitive to all, and clear data transfers are acceptable.  Probably still a good idea to take measures to protect the credentials at least.

  • need help with xml data

    Hi all

    need your spiritual help once more!
    I have a table 'product' as below:

    create table product)
    product_id number (2),
    product_info varchar (4000));

    Select * from product:
    product_id product_info
    1 < ticketing > < product = 'TV' > < productservice = "shipping" > < / productservice > < / product = 'TV' > < / ticket >

    I need to get the column product_info information in a new table with 2 columns product and productservice product_details. as in: -.
    Select * from product_details:
    product_id product productservice
    1 expedition TV

    any suggestions on how to do it.
    PS-> for a product it can be several services and there may be several products for a ticket.

    Your XML file is not well formed at all (so many errors in there).

    However, if you had a valid XML code, you could do something like that...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 1 as product_id, '' as product_info from dual union all
      2             select 2, '' from dual)
      3  --
      4  -- end of test data
      5  --
      6  select t.product_id, x.*
      7  from t
      8      ,xmltable('/ticketing/product'
      9                passing xmltype(t.product_info)
     10                columns product varchar2(10) path '/product/@name'
     11                       ,service varchar2(15) path '/product/productservice/@name'
     12*              ) x
    SQL> /
    
    PRODUCT_ID PRODUCT    SERVICE
    ---------- ---------- ---------------
             1 TV         shipping
             2 VCR        delivered
    
  • So close but need help to compare strings in different subforms with loop - Livecycle ARE for

    For some reason, I wasn't able to do this post in the forum of Livecycle ES, even though I posted it there often in the past.

    I've created a form that I almost work and I hope that someone can help me.

    We have eight teams billing in our society and each team works anywhere from 1 to 4 different clients. The form is used to track, by the representative of billing, the number of shipments that every billing r5ep works every day. What I need to add at the bottom is a subform that performs the totals by customer. So, I try to get the form to loop through all existing subforms (and subforms in their breast) and compare a cell in the subform from bottom for a cell in other subforms, which are added dynamically, and then total ONLY items. My script does not work however.

    What I have now is:

    var repCount is form1. P1._rep. Count

    var itemCount is form1. P1. Rep._ItemSet.count

    for (x = 0; x < repCount; x ++)

    {

    for (i = 0; i < itemCount; i ++)

    {

    If (clientName.rawValue is P1.rep [x]. ItemSet [i].client.rawValue)

    {

    this.rawValue is this.rawValue + P1.rep [x]. Itemset [i].corresp.rawValue;

    }

    }

    }

    It seems like it should work, but I get the following error:

    P1. Rep [x] is undefined


    So what it looks like, is that miss me is the right way to reference objects in these subforms.

    Form is here: https://Acrobat.com/#d=20gWXZ4sBm4OPV6oO76zSg

    If someone could take a look, I would be very grateful.

    Thank you

    JO

    I don't know anyone else will ever I had a similar problem, but I thought I would go ahead and post the solution, just in case...

    The error I received (P1.resolveNode ("rep [" + j + "].")) (("Set [' + i + '"] ') is nothing) was occurring because the variable itemCount needed to be referenced in the repCount of loops. I also need to resolve the node for itemCount, that I was not doing.

    So... my old code was this:

    var repCount = P1._rep.count;

    var itemCount = P1.rep._ItemSet.count;   //this part threw the error. Use resolveNode... and should not declare the variable until, within the first loop of For.

    nTotal var = 0;

    for (var j = 0; j)

    for (var i = 0; i)

    If (P1.resolveNode ("rep [" + j + "].")) ("Set [" + i + "]"). client.rawValue == clientName.rawValue) {}

    nTotal = nTotal + P1.resolveNode ("rep [" + j + "].") ("Set [" + i + "]"). corresp.rawValue;

    }

    }

    }

    this.rawValue = nTotal;

    .. .who wasn't because he was trying County of itemset right up front... goal, it was expected that within the first iteration of subfields repCount reference... AND that it was necessary to have used resolveNode.

    The corrected code is:

    var repCount = P1._rep.count;

    this.rawValue = 0;

    for (var j = 0; j)

    var itemCount = P1.resolveNode("rep["+j+"]")._ItemSet.count;  //corrected code... node is resolved and the variable is declared in the first subform repCount.

    for (var i = 0; i)

    If (P1.resolveNode ("rep [" + j + "].")) ("Set [" + i + "]"). client.rawValue == clientName.rawValue) {}

    this.rawValue = this.rawValue + P1.resolveNode ("rep [" + j + "].") ("Set [" + i + "]"). corresp.rawValue;

    }

    }

    }

    .. who works now perfectly... and I throw a party to celebrate! Laughing out loud

    JO

  • What is the 'Live' page and need help with the data merge

    Hello

    Im very new to indesign naked with me. Im trying to merge data (need to create a fusion template?) and what I understand is that I need to be on the page 'Live '. Someone on the forum suggested this...

    There are two ways to set up the model of fusion. You can put your placholders on the master page or on the live page. If the placehlders are on the master page, only the frame (s) with placeholders, as well as other grouped objects, will be duplicated. On the live page, ID will try to duplictate EVERYTHING on the page, so you must be very careful about installation and sizing of objects.

    I want to be on the LIVE page... How can I do this? Got any other sort but can't get several records for the life of me to come.

    Thank you for your help adavance

    It is the opposite of multiple records per page. Make x copies of a single record on a page, put x sets of organized placeholders as you want on the page. A good way to do it is with Edit > step and repeat after you set up the left superior set. Now merge as one record per page.

Maybe you are looking for