Need to change the date of

Oracle Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production version

Hi gurus

Need your help again and grateful if someone help out me. I have the following data:

staging as

(

Select 100 grp, to_date('01032008','dd-mm-yyyy') bt_eff_dt, to_date('31034444','dd-mm-yyyy') bt_ter_dt double

Union of all the

Select 200 BRM, to_date('01052008','dd-mm-yyyy') bt_eff_dt, to_date('31034444','dd-mm-yyyy') bt_ter_dt double

Union of all the

Select 300 grp, to_date('01062008','dd-mm-yyyy') bt_eff_dt, to_date('31034444','dd-mm-yyyy') bt_ter_dt double

),

Rondy as

(

Select 100 grp, to_date('01062006','dd-mm-yyyy') r_eff_dt, to_date('31034444','dd-mm-yyyy') r_ter_dt double

Union of all the

Select grp, to_date('01032008','dd-mm-yyyy') 100, to_date('28032015','dd-mm-yyyy') of the double

Union of all the

Select 200 BRM, to_date('01032008','dd-mm-yyyy'), to_date('28032015','dd-mm-yyyy') of the double

Union of all the

Select grp, to_date('01032010','dd-mm-yyyy') 300, the double to_date('28032015','dd-mm-yyyy')

)

Select s.grp, min (r_eff_dt), max (r_ter_dt)

Since the staging of s, r rondy

where s.grp = r.grp

S.grp group

;

The query result

GRP, MIN (R_EFF_DT), MAX (R_TER_DT)

10006/06/0144 03-31
30003/10/0115/03/28
20003/08/0115/03/28

If you see the result of the query, and then there min and max date based on fiberglass but I need min and max date based on staging.bt_eff_dt.

for example:

-If rondy.r_eff_dt < staging.bt_eff_dt and other record exist in the table rondy for same grp who have same rondy.r_eff_dt as staging.bt_eff_dt can get to the records.

-If rondy.r_eff_dt < staging.bt_eff_dt and any other file not exist in the table for same grp rondy then get the staging.bt_eff_dt.

-If rondy.r_eff_dt > staging.bt_eff_dt then no change.

On the basis of the above rule, my output should be:

GRP, MIN (R_EFF_DT), MAX (R_TER_DT)

1000103200828032015
3000103201028032015
20001052008' 28032015

Please let me know if you have any questions and sorry for my bad English.

Hello

979596 wrote:

Oracle Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production version

...

staging as

(

Select 100 grp, to_date('01032008','dd-mm-yyyy') bt_eff_dt, to_date('31034444','dd-mm-yyyy') bt_ter_dt double

Union of all the

Select 200 BRM, to_date('01052008','dd-mm-yyyy') bt_eff_dt, to_date('31034444','dd-mm-yyyy') bt_ter_dt double

Union of all the

Select 300 grp, to_date('01062008','dd-mm-yyyy') bt_eff_dt, to_date('31034444','dd-mm-yyyy') bt_ter_dt double

),

Rondy as

(

Select 100 grp, to_date('01062006','dd-mm-yyyy') r_eff_dt, to_date('31034444','dd-mm-yyyy') r_ter_dt double

Union of all the

Select grp, to_date('01032008','dd-mm-yyyy') 100, to_date('28032015','dd-mm-yyyy') of the double

Union of all the

Select 200 BRM, to_date('01032008','dd-mm-yyyy'), to_date('28032015','dd-mm-yyyy') of the double

Union of all the

Select grp, to_date('01032010','dd-mm-yyyy') 300, the double to_date('28032015','dd-mm-yyyy')

)

...

If you see the result of the query, and then there min and max date based on fiberglass but I need min and max date based on staging.bt_eff_dt.

for example:

-If rondy.r_eff_dt< staging.bt_eff_dt="" and="" other="" record="" exist="" in="" rondy="" table="" for="" same="" grp ="" that="" have="" same="" rondy.r_eff_dt="" like="" staging.bt_eff_dt ="" then="" get="" that="">

-If rondy.r_eff_dt< staging.bt_eff_dt ="" and="" other="" record="" not="" exist="" in="" rondy="" table="" for="" same="" grp="" then="" get="" the="" staging.bt_eff_dt="">

-If rondy.r_eff_dt > staging.bt_eff_dt then no change.

On the basis of the above rule, my output should be:

GRP, MIN (R_EFF_DT), MAX (R_TER_DT)

100 01032008 28032015
300 01032010 28032015
200 01052008 ' 28032015

Please let me know if you have any questions and sorry for my bad English.

Are you sure that these are the results that you want from the given sample data?  Did you mean 01062008 for grp = 200, instead of 01052008?

Here's one way:

WITH got_r_num AS

(

SELECT r.grp, s.bt_eff_dt, r.r_ter_dt

DENSE_RANK () OVER (PARTITION BY r.grp

ORDER OF CASES

WHEN r.r_eff_dt = s.bt_eff_dt

THEN "A".

OF ANOTHER 'B '.

END

) AS r_num

From rondy r

S staging of JOIN ON s.grp = r.grp

)

SELECT the grp, bt_eff_dt, r_ter_dt

OF got_r_num

WHERE r_num = 1

;

Tags: Database

Similar Questions

  • Is this ok to change the date of a photograph to the 1800s?

    I think I need to change the dates on about 400 pictures.  Enter a return date in the 1800s would cause a problem with the computer?

    This part of my family history project, which I had completely organized events in iPhoto, Photo is now a bunch of totally random photos.  They were initially examined in groups as I found them over a period of years - so in Moments - a big mess.  I had them in events either by individual or their own cell family, and of course I could merge or add however that I had to.

    Don't know yet, but I think that my best option now is to modify the dates first, just to try and get some semblance of order to it, then try to work out a system with Albums.

    Thank you

    Lynne

    I used "Set Date & Time" to put back the date of the year 1000, with no ill effects.

    I did to split times - it is very convenient to separate them all just by moving a few photos in time by 1000 years. So to adjust the dates for 200 years should be no problem.

    To adjust the dates of sins, I use this script: see this tip to user: Script: batch change Date and time on a fixed Date

    https://discussions.Apple.com/docs/doc-8421

    This script allows you to set the date and time of the selected photos to a fixed date, incremented a constant interval, for example a minute. I use it, if I don't know the exact date and time, but I just don't want the time, so photos can be sorted by time.

  • How to change the date system Satellite Pro 4200?

    Hello
    I need to change the date of my system and I didn't know how. I go into the BIOS and there is nothing to change the date. I have no operating system. I used to install Linux, but first I must change the date. Please can tell me how I can do? Sorry, but my English is not very good.

    Slovak som

    Hello

    Generally, it should be possible to change the time and date in the BIOS.
    What BIOS you have? Toshiba or Phoenix?

  • How can I change the date on my outgoing faxes on my officejet hp 4620?

    I can't seem to access the HP support page to change the settings on my HP Officejet 4620 e all-in-one.  I need to change the date on my Fax of Jan 00 0000 to the correct date.  Am brand new to this machine and I don't know where to go to get this info. Help.

    Hello

    Please follow step eight below in order to set the Date and time:

    http://support.HP.com/us-en/document/c03149951

    Kind regards

    Shlomi

  • script to change the data type of column

    Hi gurus of the oracle.

    I have 190 tables in my database.

    I have the column type CHAR of all these tables data.

    I need to change the data type of CHAR in VARCHAR2 for all these tables...

    There the script to change the data type of all tables at once?

    Please help me in this regard.

    Thanks in advance

    Concerning

    REDA

    Hello

    There is nothing built-in to Oracle SQL to do.  Maybe your front-end has certain characteristics.

    You can write dynamic SQL statements to do.  In other words, you can write a query that the output is a SQL script like this:

    ALTER TABLE TABLE_A CHANGE (A_TXT1 VARCHAR2 (5))

    A_TXT2 VARCHAR2 (10));

    ALTER TABLE TABLE_B CHANGE (B_TXT1 VARCHAR2 (5));

    with one row for each column of type CHAR.  Notice how the first line of output for each table begins with ALTER TABLE... but the later lines at the same table.  Similarly, the last line of a table (which will be the same as the first row, if the table has only one column of type CHAR) to end with a semicolon, but other lines are not.

    Here's a way to generate and execute such a dynamic script in SQL * more:

    -Disable the features that make the output easy to read, but hinder the execution
    SET FEEDBACK OFF
    SET LINESIZE 500
    SET PAGESIZE 0

    -Create fix_char.sql
    COIL c:\some_pathename\fix_char.sql

    SELECT THE CHECK BOX
    WHEN ROW_NUMBER () OVER (PARTITION BY table_name
    ORDER BY column_name
    )  = 1
    THEN 'ALTER TABLE ' | table-name
    || "CHANGE (").
    ELSE «»
    END
    ||        column_name
    ||        "VARCHAR2 (').
    ||        DATA_LENGTH
    ||        ')'
    ||        CASE
    WHEN ROW_NUMBER () OVER (PARTITION BY table_name
    ORDER BY column_name DESC
    )  = 1
    THEN '); "
    Output END AS
    Of user_tab_columns
    WHERE data_type = "CHAR".
    ORDER BY table_name
    column_name
    ;

    SPOOL OFF

    -Turn on the features that make the output easy to read, but hinder the execution
    SET FEEDBACK ON
    SET LINESIZE 80
    SET PAGESIZE 50

    -Fix_char.sql performance
    @c:\some_pathname\fix_char

    It's good to change all the CHARIOT of VARCHAR2 columns.  The CHAR data type is nothing trouble.

  • How can I change the date on when I pay my Bill?

    I need to change the date when I paid my Adobe Creative Cloud membership. I've done it before, but I don't remember how. Anyone know?

    Hi Jack,

    There is no change in the invoice date of the subscriptions of CC process.

    For more information, you can see the discussion below.

    The date change Creative Cloud subscription is paid

    Hope this will help you.

    Kind regards

    Hervé Khare

  • Change the data displayed through the context menu

    I have a long list of data which must be reduced. Is there a formula/function that will change the data as determined by a context menu? For example:

    If I had to choose 'Brown' in the menu dropdown only entries whose hair is brown above, would be displayed (IE. Bilbo and Gimli); all others are hidden/not shown. To complicate matters, I have data in two different columns that I need to refine the list by: in this case, the color of their hair, or the number of letters of their first name.

    Using numbers 3.6.1 in El Capitan. Thanks in advance for your help.

    If you restrict the list of several columns have considered using filters (in the Panel on the right after clicking on "Sort and filter" in the toolbar)?  You can add rules on more than one column at a time.

    SG

  • How can I change the date of 1970 until 2015, because I can't reboot my iphone!

    I can't reboot my iphone, after when I changed the date from 02.12. 2016 to January 1, 1970. How can I restart my iphone? Can I repair my iphone?

    You can read about it in this post:January 1, 1970

    The short answer is that you need to take your device to an Apple Store, as when you set to January 1, 1970, the brick permanently the iPhone.

  • To change the data type of control/led

    Is it possible to change the underlying data type of the indicator or a control?  I a VI that I want to use that accepts any type of data (essentially data varriant) and display it accordingly.  I have different controls selected to display data of different types in the sense of data vs decimal boolean data vs integer, but certain types of data will be of type uint32 vs int16 vs uint64 etc..  Is it possible to programmatically change the data type, so I need to have all the combinations of indicators?

    The short answer is no. The long answer is that LabVIEW has not 'generic' controls that allow you to display any type of data (apart from the variant of course). There are several ways to address this problem, but all require you as the programmer to manage explicitly each type of data you could possibly meet. Here are some possibilities (in no particular order), please let me know if you would like to help a particular implementation of these.

    1. Force incoming data to variant, use the info option to determine the data type of the original data in a case structure (open G can do this VERY easy), have an indicator on the front panel for each type of data you want and hide those unused
    2. Use a sub-group of experts on the front panel and sub - vi call of to view specific types (that lends itself very well to encapsulate your data in a class and you leave OOP allows to expand into different types of data)
    3. Use a tab with the variant (similar to option 1) control put each kind of data in its own tab, enable only the current
    4. Do a Control-X to accept a Variant option 1 under the hood
    5. Just as a string of format and use a string indicator

    That's all I can think of right now, once again, let me know if you need more information/help on the options.

  • I need to change the drive to a new drive letter, but XP will not let me because he thinks that the letter is in use.

    Quick question: I need to change the drive to a new drive letter, but XP will not let me because he thinks that the letter is in use, when it is not.

    The question for a long time: I've updated two disks in my computer from 1 TB to 2 TB. They were e and K:. The KC: drive is used as a backup of data on E: drive.

    I copied all the data on the old drive E: to the new, but when I put the new drive in place of the old, XP wouldn't let me assign the E: drive letter. It is ironic that several times, I see the warning that if you change a drive letter, some programs may not work - so of course that Microsoft is aware of this problem - however, it is annoying when you NEED to change a drive letter to OPERATE programs, but Windows won't let you. Sometimes, trying to protect users from doing stupid things prevents them from making things work...

    Anyway, after some research, I discovered that if I put the drive E: OLD and "remove" the drive of her letter, then the letter E: becomes available again. It did not work, and my computer is now partially satisfied with his new E: drive. However, the same trick with the new drive K: does NOT work.

    I removed the letter 'k': the old K: drive, but when I install a new one, it won't let me change it. It happens to be stuck at 'l': it's no use to me because backup programs are ready to use the K:\ path.

    There is that no "K:" drive in my computer and I deleted the letter k: the old disk. How do I FORCE XP to designate the new drive K: so that my backup program can work again?

    Thank you.

    Did you try to start your computer in Mode without fail (repeatedly, key to tap the F8 as your computer starts) and then try to re-assignment of drive letters?
    I think that some programs on your machine may be playing with your drive letters.  Boot safe mode will allow Windows to operate with a minimum of processes that are running and you should be able to change drive letters in these conditions.

    HTH,
    JW

  • I had no success to determine how to change the date, time, attributes etc (although the name can be changed) files in Vista Home Basic that I was able to do in Windows 98 Second edition. __Is their a reasonable solution to this? __Thanks

    It is my first visit to this feature of Microsoft Internet.  It defines a model for constructive citizen of the world form a more perfect union.
    Thank you.

    A "more perfect union"? Really? I'm not terribly interested in forming a union with a person, perfect or not, but I'll gladly try to help you with your it questions. To do this, you will need to provide more information about your computer and your questions clearly and concisely in the body of the message, not in the subject line. These links will help you with your next post:

    http://www.elephantboycomputers.com/page2.html#Usenet (you can ignore the references to Usenet discussion groups / as you post on a web forum, but any suggestions on how to write the post are applies here too)

    http://support.microsoft.com/default.aspx/kb/555375 - how to ask a Question

    Change the date and time of Vista:

    http://Windows.Microsoft.com/en-us/Windows-Vista/set-the-clock

    Don't know what you mean by "attributes".

    You change a file name in Vista right click on the file and then left-click 'Rename' or by clicking the file to select it by pressing F2. MS - MVP - Elephant Boy computers - don't panic!

  • Vista continues to change the date of modification on my files.

    Vista continues to change the date of modification on my files.  It's on a shelf; I use Word and log a lot and sometimes need to sort by the update.  and then Vista arrives and changes the date on everything... I'm doing something wrong?

    Hi Joyfnp,

    O the date system is not accurate?

    O since when are you facing this problem?

    O recent changes made on your computer?

    In the meantime, you can start your computer in safe mode and check if the problem persists.

    http://Windows.Microsoft.com/en-us/Windows-Vista/start-your-computer-in-safe-mode

    Bindu S -Microsoft Support

    [If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message.] [Marking a post as answer, or relatively useful, you help others find the answer more quickly.]

  • How can I change the date used to filter the screen heat for a resource map?

    The dates that appear at the top of the heat map of resources are blocked on March 2014 until August 2014. How can I change these dates to see the current and future commitments to my resources?

    HeatMapDates.png

    To change the dates, you will need to save on the registration page and modify the advanced search criteria. These filter dates apply for the following clicks and pages of details when displaying resources.

  • Change the date format. MinValue?

    How can I change the date format. MinValue?

    If you get any solution for this, a work around you can try and update us if it works or not:

    Go to your date attribute in DataControls.dcx (you must first select the control of your data)

    You may need to click on change icon to open the XML.

    Under guidance UI do following changes:

    Type of format - Format of Date Simple

    -The format DD/MM/YYYY

  • When I connect to Photoshop CC I still can't go to the program - I need to change the host file?

    When I connect to Photoshop CC I still can't go to the program - I need to change the host file?

    Please follow it mentioned below as follows:

    1 complete the process / Task Manager tasks in the same order, as mentioned below the Manager tasks. See, Open the Task Manager

    • Creative cloud
    • Basic timing & sync to basic support
    • CC library & process CCX
    • Adobe Common Desktop
    • Adobe update daemon
    • Broker CIB Adobe
    • After that, everything that said adobe on it do a force quit for her

    2 - C:\Users\\AppData\Local\Adobe\ MAA UPDATER and two OOBE (App data & Program Data is hidden folder please see, Show files and folders hidden in Windows 7, 8.x, 10, or Vista)

    3 reset the hosts - IP addresses redirected file may prevent you to complete the authorization process.

    4 - CUT any security software installed with firewall system, also if your having any browser Add On installed for blocking advertising that turn off too.

    These changes are temporary you can restore these changes back to normal once your creative cloud app is running *.

    5 - raise the cloud creative app and connect

    Let us know if that helps.

Maybe you are looking for