Combine the size and attributes with application Dates

Hello, I'm trying to combine data from two tables (DIMENSION and ATTRIBUTES) below and load the data corresponding to the OUTPUT.

Can anyone share idea on how I can combine the two? (attribute table has no ID and has only COUNTRY & TYPE to join DIMENSION)

Version Oracle 11g: (11.2.0.2)


DATA_SAMPLE.PNG

CREATE TABLE DIM (ID VARCHAR2 (10), NAME VARCHAR2 (20), TYPE VARCHAR2 (20), COUNTRY VARCHAR2 (2), EFF_DT DATE, DATE END_DT);

CREATE THE TABLE ATTRIBUTES (TYPE VARCHAR2 (20), COUNTRY VARCHAR2 (2), CHAR (1) OF THE CLASS, EFF_DT DATE, DATE END_DT);

INSERT INTO VALUES('1','ABC','A','US',TO_DATE('30-SEP-2013','DD-MON-YYYY'),TO_DATE('31-DEC-2099','DD-MON-YYYY')) DIM;

INSERT INTO VALUES('1','ABC','A','CA',TO_DATE('30-SEP-2013','DD-MON-YYYY'),TO_DATE('31-DEC-2099','DD-MON-YYYY')) DIM;

INSERT IN DIM values('2','XYZ','B','US',TO_DATE('3-FEB-2014','DD-MON-YYYY'),TO_DATE('31-DEC-2099','DD-MON-YYYY'));

INSERT IN the values('A','US','C',TO_DATE('1-JAN-2014','DD-MON-YYYY'),TO_DATE('28-SEP-2014','DD-MON-YYYY ATTRIBUTES '));

INSERT IN the values('A','US','C',TO_DATE('29-SEP-2014','DD-MON-YYYY'),TO_DATE('31-DEC-2099','DD-MON-YYYY ATTRIBUTES '));

INSERT IN the values('A','CA','E',TO_DATE('1-JAN-2014','DD-MON-YYYY'),TO_DATE('28-OCT-2014','DD-MON-YYYY ATTRIBUTES '));

INSERT IN the values('A','CA','E',TO_DATE('29-OCT-2014','DD-MON-YYYY'),TO_DATE('31-DEC-2099','DD-MON-YYYY ATTRIBUTES '));

Thank you.

Maybe let separate everything first delete duplicates

with

Sun did

(select id '1', the name of 'ABC', 'A' type, 'US' country, to_date('30-SEP-2013','DD-MON-YYYY') eff_dt, to_date('31-DEC-2099','DD-MON-YYYY') end_dt Union double all the)

Select '1','ABC','A','CA',to_date('30-SEP-2013','DD-MON-YYYY'),to_date('31-DEC-2099','DD-MON-YYYY') of all the double union

Select '2','XYZ','B','US',to_date('3-FEB-2014','DD-MON-YYYY'),to_date('31-DEC-2099','DD-MON-YYYY') of the double

),

attributes such as

(select 'A' type, countries 'US', 'C' class, to_date('1-JAN-2014','DD-MON-YYYY') eff_dt, to_date('28-SEP-2014','DD-MON-YYYY') end_dt Union double all the)

Select 'A','US','C',to_date('29-SEP-2014','DD-MON-YYYY'),to_date('31-DEC-2099','DD-MON-YYYY') of all the double union

Select 'A','CA','E',to_date('1-JAN-2014','DD-MON-YYYY'),to_date('28-OCT-2014','DD-MON-YYYY') of all the double union

Select 'A','CA','E',to_date('29-OCT-2014','DD-MON-YYYY'),to_date('31-DEC-2099','DD-MON-YYYY') of the double

)

SELECT id, name, type, country, class, eff_dt, end_dt

NVL (lead (eff_dt) over (partition BY id, type, order of eff_dt countries) - 1, end_dt) end_dt_new

from (select distinct id, name, coalesce(type_d,type_a) type, country, case when x = 'a' then class end class, eff_dt,)

-case when end_dt = date ' 2099-12-31' then add_months (trunc (eff_dt, 'yyyy'), 12)-1 else end_dt end end_dt

from (select d.id, d.name, d.typ subscription_type, a.typ type_a, d.country, a.class,)

d.eff_dt d_eff_dt, d.end_dt d_end_dt, a.eff_dt a_eff_dt, a.end_dt a_end_dt

Dim d

full outer join

attributes one

We d.country = a.country

and d.typ = a.typ

)

UNPIVOT ((eff_dt,end_dt) for x in ((d_eff_dt,d_end_dt) as ' of,(a_eff_dt,a_end_dt) like 'a'))

)

order by 1,2,3,4,6

ID NAME TYP COUNTRY CLASS EFF_DT END_DT END_DT_NEW
1 ABC A CA - 30/09/2013 31/12/2013 31/12/2013
1 ABC A CA E 01/01/2014 28/10/2014 28/10/2014
1 ABC A CA E 29/10/2014 31/12/2014 31/12/2014
1 ABC A WE - 30/09/2013 31/12/2013 31/12/2013
1 ABC A WE C 01/01/2014 28/09/2014 28/09/2014
1 ABC A WE C 29/09/2014 31/12/2014 31/12/2014
2 XYZ B WE - 03/02/2014 31/12/2014 31/12/2014

Concerning

Etbin

Tags: Database

Similar Questions

  • error starting "C:\Document and Setting\user_name\Application Data\wlaplg.dll the specified module cannot be found"

    Original title: error loading of C:\Document and Setting\user_name\Application Data\wlaplg.dll the specified module could not be found

    For two or three weeks there whenever I boot my netbook and connect to my user account window I found this error message RUNDLL pop-up window:

    Error loading of C:\Document and Setting\myusername\Application Data\wlaplg.dll

    The specified module could not be found

    What is the problem? and how to solve?

    Hello

    Click on Start menu and click Run.
    Inside run, type MSCONFIG and press Ok.
    Now, you will get a System Configuration window.
    Inside you go to the tab called start-up
    In the Startup tab, you can see a list of files from loading when you start the computer.

    There, you can see the above file Rundll32, "C:\Document and Setting\user_name\Application Data\wlaplg.dll ' like this.

    A chech this one and press apply and press Ok.
    Now you will be asked to restart the computer.

    The problem will be solved after restarting...

  • Change the brush size and hardness with CTRL-OPT-DRAG

    It may seem a strange question, but I can not just use the shortcut to change the size and hardness of the brush in CS5: Ctrl + Opt-make slide

    I work on a MacBook Pro with a magic mouse. As soon as I click CTRL, to the tip of the needle, a small box appears (a menu icon) and then if I click, opens the brush menu.

    I'm working on a french keyboard and I don't know how to change this shortcut because I don't need to reassign a key, but a 'action '.

    I reset all the shortcuts to the original settings in the keyboard preferences.

    Oh, and Yes, I select the OpenGL option.

    It seems really easy, but it drives me crazy!

    If anyone has an answer, which would be really useful!

    Thank you

    I'm not sure. Maybe something on the french keyboard?

    There are also a few reports about 10.6.5 update interfere with the essential operations of normal modifier in Photoshop.

  • Change the size and font for any field type?

    Because that copy / paste to the font size and type with it I want to create a script which change

    I tried get to the function 'exit' of the material as follows:

    Form1. TestPage.Subform1.TextField1.font.size = '10pt '.

    Form1. TestPage.Subform1.TextField1.font.typeface = "Myriad Pro";

    I also tried a search field button changes to a script I found online, but it does not work for me:

    function ProcessTextEdit (oField)

    {

    }

    function ProcessAllFields (oNode)

    {

    If (oNode.className is "subform")

    {

    Search fields in the child.

    for (var i = 0; i < oNode.nodes.length; i ++)

    {

    var oChildNode = oNode.nodes.item (i);

    ProcessAllFields (oChildNode);

    }

    }

    Else if (oNode.className == "field")

    {

    Switch (oNode.ui.oneOfChild.className)

    {

    case "textEdit":

    If (oNode.parent.className is "Subform")

    {

    Form1. TestPage.Subform1.TextField1.font.size = '10pt '.

    Form1. TestPage.Subform1.TextField1.font.typeface = "Myriad Pro";

    }

    }

    }

    }

    No luck. Any suggestions?

    I tried the only control font size and type everything by allowing users to retain the flexibility to use color, bold, underline, etc. to highlight certain information when he text above. Plain text allows it. So far, everything I've read, is not possible because Livecycle is not able to control the attribute of Rich Text of the word imported into a Rich text box in Livecycle.

  • What is C:/documents and settings/temp/application data/microsoft/fsx/fsx.cfg txt

    What makes c; / documents and settings/temp/application/data medium txt microsoft/fsx/fsx.cfg

    Hello

    1. what exactly is the problem that you are facing on the computer?

    2. have you installed Flight Simulator X on the computer?

    See the article and check if that helps:

    How to change FSX. CFG to set the maximum amount of autogen objects in a field cell

    http://support.Microsoft.com/kb/555739

    Please provide more information to help you best.

  • I don't know how to change the size and quality of the text on the screen on Windows 7

    I just installed a new Windows 7 but I don't know how to change the size and quality of the text on the screen.  I tried all the things normal, resolution, size of icons, dpi etc but nothing gives me what I want.  The text in clear 'wonderful' thing is just terrible.  When I go through the 4 steps I see no text boxes which make the text nothing better.  All options are terrible, so the result on screen is too terrible.  When I do any huge I do not get a full screen of things - view the Start button disappears or I did not closing small cross at the top - of the suggestions to inprove the situation?  I must mention that my screen/monitor is 2006 - I need to buy a new one?  How much is this Windows 7 is going to cost me, or maybe I should go back to XP!

    I sincerely thank all you smart "technicians" for all the answers you always gave myself and all others who ask questions.  I'm not too smart with all this new technology as I fell into it very late.  I am now in my 60s and only started using a pc when I was over 50 years so...  In any case, I asked a question about the size of screen resolution and text and received much good advice from all that you guys.  I had recently changed in XP to Windows 7.  However, the bit of advice that I was given in 'Cyberking' here at the Portugal had set the resolution of the screen, the advanced settings, 75 to 60 Hertz Monitor tab.  Very basic, and the first question asked the technician (Lady) was "what size is your screen?  Naturally as a smaller screen that any 'techno' would be considered dead aid, solving the problem was simple and straightforward without me having to stretch my knowledge and my skills by downloading all programes weird (to me) or do the funny stuff in the bios or something else.  I send this comment to you for you to realize that the simple solution is not always bad and maybe we should go for the easiest first and then work up to the more difficult ones.

    Just for you all to see - now my screen resolution is perfect, the text on the screen is clear and legible without difficulty, even though the size of text and icon is small.  Clarity is all!

    Thank you all once again!   Best regards, Blondie blue.

  • Size and type of Application Logo BlackBerry?

    Hello

    Can someone tell me the size and the file format for the application icon?

    reflecting the best effects.

    Thank you and best regards,

    Narendra Shekhawat.

    That's the different themes available on the device.

  • cannot access the folders of hidden files "Application Data", "My Documents", "Local Settings" etc..

    I have a few hidden items in the directory to my windows user account which look like shortcuts, but are of type folder and are named 'Application Data', 'My Documents', 'Local Settings' etc.

    If I try to access the folder, it says:

    C:\Users\xx\My Documents\ is not accessible.

    Access denied

    Where he comes from and can remove the?

    It is, in addition to user accounts by default Windows, single user account on this system, which is of course also an administrator account.

    ... I also get the same message when I try to access the Documents and Settigs on my C drive...

    A clarification would be much appreciated!

    These elements are not records - what are the Points of junction. They are there to allow legacy applications to use the new Vista/Windows 7 file structure.

    Here is a list of all junction points and Windows 7 files, what they point out:

    C:\Documents and Settings - C:\Users\{user name} \Documents
    Application Data - C:\Users\{user name} \AppData\Roaming
    Cookies - name C:\Users\{user} \AppData\Roaming\Microsoft\Windows\Cookies
    History - name C:\Users\{user} \AppData\Local\Microsoft\Windows\History
    Locale - name C:\Users\{user} \AppData\Local
    NetHood - C:\Users\{user name} \AppData\Roaming\Microsoft\Windows\Network shortcuts
    Print neighborhood - C:\Users\{user name} \AppData\Roaming\Microsoft\Windows\Printer shortcuts
    {Recent - name C:\Users\{user} \AppData\Roaming\Microsoft\Windows\Recent
    SendTo - name C:\Users\{user} \AppData\Roaming\Microsoft\Windows\SendTo
    Start Menu - C:\Users\{user name} \AppData\Roaming\Microsoft\Windows\Start Menu
    Models - C:\Users\{user name} \AppData\Roaming
    Temporary Internet files - C:\Users\{user name} \AppData\Local\Microsoft\Windows\Temporary Internet Files

    More information on the Points of junction here:

    http://www.Svrops.com/Svrops/articles/jpoints.htm

  • combine the alpha and visibility?

    Hi all

    Here it goes...

    I have this site with a melted white in / hide a menu.  I try to get the menu a little more visible.  Because the menu is in white font, and the images, he jumps at the chance to have a white background, it creates a little problem.

    I created a big clip that matches the height and the width of the stage.  I am the appellant "bg".  The idea is when one hovers over the menu 'projects', the bg movieclip fades to cloud the entire file with the exception of the menu.  I'll set the alpha of the bg initially to 0, while she can fade using TweenLite when the mc projects is overthrown, and fade out when projects are out.  I would like to just do it all using alpha if I could, but here's the problem: for screening to work on the whole of the file, she has also work on my loaded external Gallery buttons in the swf and it is.  When the mc bg disappears and all shades, he gets in front of the buttons and you can not access it.  Then... I need to combine the melted thing alpha with deactivation of the visible bg.  Is anyway to do this both at the same time?  Okay now I either get nice fades and the visibility does nothing, or nice fade ins BG, then an abrupt change when visibilty exceeds anything on the roll... Sorry this is confusing.  Here is the code I use.

    projects.addEventListener (MouseEvent.ROLL_OVER, onOverProj, false, 0, true);

    function onOverProj(evt:MouseEvent):void {}

    TweenMax.to (bg, 0, {visible: true});

    TweenLite.to (bg,.3, {alpha: 1});

    TweenLite.to (projects,.3, {alpha: 1});

    TweenLite.to (lakeside,.3, {alpha: 90});

    TweenLite.to (Athens,.3, {alpha: 90});

    }

    proj_hit.addEventListener (MouseEvent.ROLL_OUT, onOutProj, false, 0, true);

    function onOutProj(evt:MouseEvent):void {}

    TweenLite.to (projects,.3, {alpha: 90});

    TweenLite.to (lakeside,.3, {alpha: 0});

    TweenLite.to (Athens,.3, {alpha: 0});

    TweenLite.to (bg,.3, {alpha: 0});

    TweenLite.to (bg, 0, {visible: false});

    }

    Assign a complete listener to the alpha for the bg interpolation and use it to trigger a function to set the visibility to 0.  Search for TweenLite onComplete if you need help with the listener.

  • How I see the size and the color of the text in DW Cs5?

    Hello forum, how do you see the size and the color of a piece of text in Dreamweaver Cs5, I text in a dreamweaver file, which is a size that I like and a color I like and I want to do a CSS rule with these features. How can you see what the size and color of a text element is?

    Thanks a lot for any help

    Gareth

    what is the text size, colour and boldness of this piece of text.

    Above code is obsolete.  CS5 won't get these styles in the Panel styles CSS.  Ancient sites are not simple to work with.  They must be converted to modern standards.  For this markup stripping and re-writing of CSS styles HTML styles.

    This is a normal paragraph

    Put your CSS styles between your documentandTags:

    Alternatively, create an external style sheet to which your HTML documents are related to this:

    http://ALT-Web.com/demos/DW-link-stylesheet.shtml

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB

  • I've updated VIA / S3G UniChrome IGP plug-and-play reverse, but the update still no resolution 1600 x 1200 with the exception and others with the same ratio of 4 x 3.

    I've updated VIA / S3G UniChrome IGP plug-and-play reverse, but the update still no resolution 1600 x 1200 with the exception and others with the same ratio of 4 x 3. That did not help.

    Hello

    1. What version of Windows are you using?
    2. What is the brand and model of the computer?

    I suggest to run the patch from the following link and check the status of the issue.

    Hardware devices do not work or are not detected in Windows.

    http://support.Microsoft.com/mats/hardware_device_problems/en-us

    If the problem persists, I suggest you to send us more information to help you better.

  • I'm administrator, but do messages telling me that what I want to do is forbidden by the administrator and verify with the system administrator

    original title: administrator problem

    I am the administrator with a password (in fact the only user of my computor) but continue to receive messages telling me that what I want to do is forbidden by the administrator and verify with the system administrator. How to work around this problem? My os is Vista Home Premium.This happens more frequently when I try to remove a program

    According to what "program", you tried to 'delete '.

    If one of these programs to the system, you will get the message.

    If it's one of those programs that you have installed from the web, try one of these programs to "Uninstall" part 3:

    Revo Uninstaller 1.91
    http://download.CNET.com/Revo-Uninstaller/3000-2096_4-10687648.HTML?tag=mncol

    IObit Uninstaller 1.1
    http://download.CNET.com/advanced-uninstaller-free/3000-2096_4-75157230.HTML?tag=mncol

    Advanced Uninstaller Free 10.1.1
    http://download.CNET.com/Revo-Uninstaller/3000-2096_4-10687648.HTML?tag=mncol

    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • After you create an action to reduce the size and convert them to JPEG format, how to eliminate the word "copy" of each image name?

    After you create an action to reduce the size and convert them to JPEG format, how to eliminate the word "copy" of each image name?

    You can batch process using the image processor script and no user action should still be included in the process.  Check out our menu file > Scripts > image processor.

  • How to change the size and color of 'staticText '?

    Can anyone share please how to change the size and color of the object "staticText"?

    function buildUI (thisObj) {}

    var myPanel = (thisObj instanceof Panel)? thisObj: new window ('pallet', 'Gear of Stress', undefined, {resizable: true});

    var txt is myPanel.add ("staticText", [0,0,100,20], "txt");.

    txt. newFont, fontSize, color?

    Return myPanel;

    }

    var myToolsPanel = buildUI (this);

    I did a quick test on a PC at the office and it seems that Gill without isn't a stock PC police. You could comment on these out or change them to a police stock as Helvetica or something. Once I removed that it has launched on PC very well.

  • To find the months and days between 2 dates

    Hello

    I want to find the months and days between 2 dates.

    For example.

    1 - Date: August 25, 2013

    2 - Date: October 23, 2013

    If we consider each month 30 days, it should give

    August 25, 2013 to August 30, 2013 = 6 days

    01-Sep-2013-30-Sep-2013 = 1 month

    October 23, 2013 to October 30, 2013 = 8 days

    Total = 1 month and 14 days.

    Kindly help as soon as possible.

    Thanks and greetings

    Suresh

    Assuming that d2 > d1,.

    where d)

    Select sysdate d1, sysdate + 56 double d2

    Union all select to_date (March 1, 2013 ',' dd-mon-yyyy "") d1, to_date (March 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (5 February 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (February 25, 2013 ',' dd-mon-yyyy "") d1, to_date (March 23, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (February 25, 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (August 2, 2013 ',' dd-mon-yyyy "") d1, to_date (29 October 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (February 1, 2013 ',' dd-mon-yyyy "") d1, to_date (May 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (25 August 2013 ',' dd-mon-yyyy "") d1, to_date ('03-Sep-2013', 'Mon-dd-yyyy') d2 double

    Union all select to_date (July 30, 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (August 30, 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (3 August 2013 ',' dd-mon-yyyy "") double d2

    Union all select to_date (3 July 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double

    Union all select to_date ('31-08-2013', ' dd-mm-yyyy'), to_date('05-10-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('31-03-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-03-2013','dd-mm-yyyy') of the double

    Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-02-2013','dd-mm-yyyy') of the double

    )

    Select d1, d2,

    1 + 30 * trunc (months_between (d2, d1)) + LESS (extract (day of d2), 30)-LESS (excerpt (d1 day), 30)

    + CASE when extracted (d2 day)< extract(day="" from="" d1)="" then="" 30="" else="" 0="" end ="">

    d

    D1 D2 DAYSBETWEEN

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

    October 10, 2013 5 December 2013 56

    March 1, 2013 30 March 31, 2013

    5 February 2013 March 31, 2013 56

    February 25, 2013 March 23, 2013 29

    February 25, 2013 March 31, 2013 36

    August 2, 2013 29 October 2013 88

    February 1, 2013 may 31, 2013 120

    August 25, 2013 03 - Sep-2013 9

    July 30, 2013 31 August 31, 2013

    July 31, 2013 August 30, 2013 31

    July 31, 2013 3 August 2013 4

    July 3, 2013 August 31, 2013 58

    31 August 2013 5 October 2013 36

    5 February 2013 March 31, 2013 56

    5 February 2013 March 5, 2013 31

    February 5, 2013 February 5, 2013 1

    In my view, which corresponds to your rules.

Maybe you are looking for