Query to find data on holidays

Hi, I have a table for special leave, which looks like this:

PROFILE_DAY VAR_DATE
REGULAR_HOLIDAY01/01/2013
H_WEEK_THURSDAY28/03/2013
H_WEEK_FRIDAY29/03/2013
REGULAR_HOLIDAY24/12/2013
REGULAR_HOLIDAY25/12/2013
REGULAR_HOLIDAY31/12/2013

And another table (LOAD_PROFILE_TEST) that contains the values of (TIME_EQ) 0-24 LOAD_PROF1 intervals 0.25 for (PROFILE_DAY) MONDAY to SUNDAY including REGULAR_HOLIDAY, H_WEEK_THURSDAY and H_WEEK_FRIDAY.  Overall, this table contains 970 records (97 separate 0-24 with interval of 0.25 per PROFILE_DAY, with 10 PROFILE_DAY).

TIME_EQ PROFILE_DAY LOAD_PROF1 LOAD_PROF2
0REGULAR_HOLIDAY11.47
0.25REGULAR_HOLIDAY11.27
0.5REGULAR_HOLIDAY11.3
0.75REGULAR_HOLIDAY11.08
0MONDAY11.27
0.25MONDAY11.33
0.5MONDAY11.18

Now I have this request to update the value of LOAD_PROF2 in the table every time that the V_DATE_OUT and V_DATE_IN parameters is entered:

UPDATE LOAD_PROFILE_TEST

SET LOAD_PROF2 = LOAD_PROF1 +: LOAD_DIFF

WHERE UPPER (PROFILE_DAY) IN (select UPPER (to_char (: V_DATE_OUT + (level 1), "fmDAY")))

of the double

connect by level < =: V_DATE_IN -: + 1 V_DATE_OUT

);

where: LOAD_DIFF is some predetermined value.

This query works fine if I'm trying to update regular days from MONDAY to SUNDAY.  What I would do is to determine if the two dates of setting, V_DATE_OUT & V_DATE_IN would fall under none of the holidays on the first table LOAD_PROFILE_TEST, and then update the lines only.  For example, V_DATE_OUT = 12/02/2013, Monday and V_DATE_IN = 06/12/2013, Friday.  The query above would update the values of the LOAD_PROF2 for PROFILE_DAY - MONDAY to FRIDAY, corresponding to the dates of 02/12/2013 and on 06/12/2013.  If, however, V_DATE_OUT = 23/12/2013, Monday and V_DATE_IN = 27/12/2013, Friday, it should update the lines corresponding to PROFILE_DAY - MONDAY 23/12/2013, THURSDAY for 26/12/2013, FRIDAY for 12 27, 2013, and REGULAR_HOLIDAY for the dates of 12 24, 2013 and 25/12/2013 since these two appear in the first table (table of holidays).  This scenario works the same way when V_DATE_OUT and/or V_DATE_IN enter the dates of 28/03/2013 and 29/03/2013.  All other dates not included in the table for special leave will be treated according to the day they fall on (from Monday to Sunday).  I hope my point is clear.  Thank you in advance.

arms777 wrote:

I have already given a test for the table,

Frank pleased to display:

"examples of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from this data."

I do not see the second statement in the create table and insert statements. Do you expect to write us your data ourselfs?

However I'll try it from scratch

merge into LOAD_PROFILE_TEST t

a_l'_aide_de)
Select distinct
Decode (var_date, null, theday, profile_day) profile_day
BeO
Select
SUPERIOR (to_char (: V_DATE_OUT + (level 1), 'fmDAY')) theday
,: V_DATE_OUT + subsist (level 1)
of the double
connect by level<= :v_date_in="" -="" :v_date_out ="" +="">
)
REG_HOLIDAYS
where
subsist = var_date (+)

) g
on (UPPER (t.PROFILE_DAY) = g.profile_day
)
When matched then update
SET LOAD_PROF2 = LOAD_PROF1 +: LOAD_DIFF

Post edited by: chris227
Fixed: added update

Tags: Database

Similar Questions

  • Problem with query to find data offset

    Hello PL/SQL gurus and Experts.

    I am not able to extract the data with the following table structure-
    drop table T2;
    create table T2(Stream, Trade, Fees) as select
    'MECHNICAL', 'Primary', '5534500' from dual union all select
    'ELECTRICAL', 'Secondary', '5285500' from DUAL union all select
    'MECHNICAL', 'Secondary', '2364535' from dual union all select
    'ELECTRICAL', 'Primary', '1734540' from DUAL union all select
    'MBE', 'Secondary', '3424500' from dual union all select
    'ELECTRONICS', 'Primary', '5004567' from DUAL union all select
    'ELECTRONICS', 'Secondary', '4543200' from DUAL union all select
    'COMPUTERS', 'Secondary', '5534500' from DUAL union all select
    'CIVIL', 'Primary', '2345500' from DUAL union all select
    'CIVIL', 'Secondary', '4456500' from DUAL union all select
    'COMPUTERS', 'Primary', '9542500' from DUAL;
    I want to extract the data in the following format-
    Stream          Trade          Fees
    MECHNICAL     Primary          5534500
              Secondary          2364535
    ELECTRICAL     Primary          1734540
              Secondary       5285500
    ELECTRONICS     Primary          5004567
              Secondary        4543200
    CIVIL          Primary          2345500
              Secondary         4456500
    MBE          Primary     
              Secondary       3424500
    Total                    34693342
    Now if I use the following query-
    SELECT CASE WHEN LAG(Stream||Trade) OVER (ORDER BY Stream, Trade, Fees) = Stream||Trade THEN NULL ELSE Stream END Stream
         , CASE WHEN LAG(Stream||Trade) OVER (ORDER BY Stream, Trade, Fees) = Stream||Trade THEN NULL ELSE Trade END Trade
         , CASE WHEN LAG(Fees) OVER (partition by Stream||Trade ORDER BY Stream, Trade, Fees) = Fees THEN NULL ELSE Fees END Fees
    FROM (     select distinct Stream, Trade, Fees from T2 ORDER BY Stream, Trade, Fees);
    SELECT  NVL2(LAG(Trade) OVER (PARTITION BY Stream, Trade ORDER BY Stream, Trade, Fees),Null,Trade) Trade,
         NVL2(LAG(Stream) OVER (PARTITION BY Stream, Trade ORDER BY Stream, Trade, Fees),Null,Stream) Stream,
         Fees
    from (select distinct Stream, Trade, Fees from T2)
    Kindly help me...
    Thank you all for your time and effort in advance.

    use the below. There would be better ways to achieve, I find it easier.

    with filtered as
    (
      select case row_number() over(partition by stream order by trade)
              when 1 then stream
              else null end stream2,trade,fees
      from t2
      order by stream,trade
    )
    select stream2 stream, trade, to_number(fees)
      from filtered
    union all
    select 'Total', null, sum(fees)
      from t2;
    
    STREAM      TRADE     TO_NUMBER(FEES)
    ----------- --------- ----------------------
    CIVIL       Primary   2345500
                Secondary 4456500
    COMPUTERS   Primary   9542500
                Secondary 5534500
    ELECTRICAL  Primary   1734540
                Secondary 5285500
    ELECTRONICS Primary   5004567
                Secondary 4543200
    MBE         Secondary 3424500
    MECHNICAL   Primary   5534500
                Secondary 2364535
    Total                 49770342     
    

    I hope that it meets your needs. If this isn't the case, then please don't forget to provide the expected results, because we have to guess, if you still want to exit expected Original or there is a diversion in it.

  • need help with query can find data back please help.

    Hi guys I have a table such as
    CREATE TABLE "FGL"
      (
        "FGL_GRNT_CODE" VARCHAR2(60),
        "FGL_FUND_CODE" VARCHAR2(60),
        "FGL_ACCT_CODE" VARCHAR2(60),
        "FGL_ORGN_CODE" VARCHAR2(60),
        "FGL_PROG_CODE" VARCHAR2(60),
        "FGL_GRNT_YEAR" VARCHAR2(60),
        "FGL_PERIOD"    VARCHAR2(60),
        "FGL_BUDGET"    VARCHAR2(60)
      )
    and I have a data as such
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','1','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','0');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','14','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','2','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7470','4730','02','10','2','200');
    I need bascially to get the total of the budget column. However this is not as simple as it sounds good (at least not for the me.) totals carried forward to the new period. you will notice that you have a period column. Basically, what im is that
    fgl_grant_year 10 1 period = account 7600 its $100 and $100 for the period 2, you see $ 100 more, it wants to not be added to this is the door on the balance. that is $100.
    So im trying to write a query that basically does the following.
    IM considering a period for the sake of this example let period 1 I get anything else. I find that the greates contributes dumpster year the amount for the period 14 (which corresponds to the total of the previous year) and add it to the amount of the current year. in this case period 1 grnt_year 11
    the expected result is therefore $700
    240055     240055     7240     4730     02     10     14     200
    240055     240055     7600     4730     02     10     14     100
    240055     240055     7600     4730     02     11     1     400
    do not forget that I am not given a just a period of the year.
    any help you guys can give would be immensely appreciated. I tried to get this to work for more than 3 days now.
    Finally broke down and put together this post

    Published by: mlov83 on Sep 14, 2011 20:48

    Hello

    Thanks for posting the CREATE TABLE and INSERT statemnts; It is very useful.

    I'm not sure that understand your needs.
    The correct output will be just one line:

    TOTAL_BUDGET
    ------------
             700
    

    or will it be 3 ranks that you posted? I guess you want just line after line.

    Do you mean that you are given a period (for example, 1).
    First you have to find the largest gfl_grnt_year which is related to this period (in this case, 11).
    Then you need to add fgl_budget lines that have to be
    (1) the specific period and the largest fgl_grnt_year, or
    (2) perriod = 14 and the previous fgl_grnt_year (in this case, 10).
    Is this fair?

    If so, here's a way to do it:

    WITH     got_greatest_year     AS
    (
         SELECT     fgl.*     -- or whatever columns are needed
         ,     MAX ( CASE
                     WHEN  fgl_period = :given_period
                     THEN  fgl_grnt_year
                    END
                  ) OVER ()     AS greatest_year
         FROM     fgl
    )
    SELECT     SUM (fgl_budget)     AS total_budget     -- or SELECT *
    FROM     got_greatest_year
    WHERE     (     fgl_grnt_year     = greatest_year
         AND     fgl_period     = :given_period
         )
    OR     (     fgl_grnt_year     = greatest_year - 1
         AND     fgl_period     = 14
         )
    ;
    

    If you want the 3 lines you have posted, then change the main SELECT clause to ' SELECT * ' (or, instead of *, youcan the columns you want to see the list).

  • Query to find data conneting that intersect each other.

    Hello

    I have a table like road_point_ids (script is below). Basically, this table have road_id with its start and its end point.

    I'm looking for a query that actually will connect each ID path beginning or end points.

    create the table road_point_ids

    (

    road_id number (10),

    start_point number (10),

    Number of end_point (10)

    );

    insert into road_point_ids

    values (1001, 10, 20);

    insert into road_point_ids

    values (1002, 20, 30);

    insert into road_point_ids

    values (1003, 30, 40);

    insert into road_point_ids

    values (1004, 40, 50);

    insert into road_point_ids

    values (1005, 50, 10);

    insert into road_point_ids

    values (1006, 70, 75);

    insert into road_point_ids

    values (1007, 30, 50);

    insert into road_point_ids

    values (1008, 10, 40);

    insert into road_point_ids

    values (1009, 80, 70);

    insert into road_point_ids

    values (1010, 90, 95);

    insert into road_point_ids

    values (1011, 50, 60);


    commit;

    SQL > select * from road_point_ids by 2;

    ROAD_ID START_POINT END_POINT

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

    1001               10                    20

    1008               10                    40

    1002               20                    30

    1007               30                    50

    1003               30                    40

    1004               40                    50

    1011               50                    60

    1005               50                    10

    1006               70                    75

    1009               80                    70

    1010               90                    95

    11 selected lines

    In the example above only seven road_ids intersect at TWO points corresponding to start or end point.

    Output desired must be as...

    ROAD_IDSTART_POINTEND_POINT
    10011020
    10022030
    10033040
    10044050
    10055010
    10073050
    10081040

    7 selected lines

    I tried to use a lot of operator AND with the OR operator but sent to an incorrect result. Could someone provide me please help.

    Thanks in advance

    Saaz

    Hi, Saaz,

    How is this problem differs from your original problem?

    If it's just that the data is now contained in 2 tables (a few lines in a table, a few lines in the other) instead of a table, you can change my original solution by using a UNION to combine the two tables into one:

    WITH road_point_ids AS

    (

    SELECT road_id, start_point, end_point OF road_point_ids_1 UNION ALL

    SELECT road_id, start_point, end_point FROM road_point_ids_2

    )

    SELECT DISTINCT road_id, start_point, end_point

    OF road_point_ids

    WHERE CONNECT_BY_ISCYCLE = 1

    CONNECT BY NOCYCLE start_point = PRIOR end_point

    ;

    The WITH clause is new; the main request is that I posted earlier.

  • Query to find data of each month

    Hello

    I have 2 tables.

    (1) Order_tb

    Name Null? Type
    ----------------------------------------- -------- ----------------------------

    ORDERID NOT NULL NUMBER
    NUMBER OF CUSTOMERID
    ORDERDATE DATE

    (2) Order_d

    Name Null? Type
    ----------------------------------------- -------- ----------------------------

    ORDERID NUMBER
    PRODUCTID NOT NULL NUMBER
    PRODUCTNAME VARCHAR2 (20)
    NUMBER OF SELLINGPRICE

    I need to find the total find the selling price for each month of the year 2012 (orderdate) total.

    I tried to use join, but I couldn't take the 2012 in particular data. Please help me on this issue.

    Thank you

    Published by: RSD on February 28, 2013 09:18

    Hello

    RSD wrote:
    I tried to use join, but I couldn't take the 2012 in particular data. Please help me on this issue.

    The WHERE clause below, is what limits the results for 2012.

    SELECT       TRUNC (t.orderdate, 'MONTH')     AS month
    ,       SUM (d.sellingprice)          AS total_sellingprice
    FROM       order_tb  t
    JOIN       order_d   d  ON  d.orderid  = t.orderid
    WHERE       t.orderdate  >= DATE '2012-01-01'
    AND       t.orderdate  <  DATE '2013-01-01'
    GROUP BY  TRUNC (t.orderdate, 'MONTH')
    ORDER BY  TRUNC (t.orderdate, 'MONTH')
    ;
    

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
    Simplify the problem. For example, pretend you're only interested in the first 3 or 4 months of 2012; We will find a solution tht can easily be adapted for 12 (or any other number) of motnhs.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • query to find space to reduce the point.

    There are storage spaces where the current use is met 90%, and we receive alerts.

    I want to know how much space to add to these storage areas (data files) that use current can be reduced to 80%. or 70%

    Is the any SQL query to find this information.

    database to Oracle 10 g.

    .


    If I have the right to calculation, is perhaps what you are looking for:

    select b.tablespace_name, (b.used_space/b.new_size) * 100 new_used_percent, b.used_percent,
           b.add_size_MB
      from (
            select tablespace_size + (((round(used_percent, 5) - 90)/100) * tablespace_size) new_size,
                   (((round(used_percent, 5) - 90)/100) * tablespace_size) add_size_MB,
                   a.*
              from dba_tablespace_usage_metrics a
           ) b;
    
  • How can I create a query with the data control to the web service?

    I need to create a query with the order of web service data, WSDL, it is query operation, there is a message of parameter with possible query criteria and a return message contains the results. I googled but can't find anything on the query with the web service. I can't find a criterion "named" to the data control of web service as normal data control. Blog of Shay, I saw the topics on the update with the data of web service command. How can I create a query with the data control to the web service? Thank you.

    Hello

    This might help

    * 054.     Search form using control data WS ADF and complex of entry types *.

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/index-101235.html

  • find data files belong to the backup piece

    Hi all

    DB 10.2.03.0

    Y at - it notice, that we can use to find data files belong to the backup piece. We can query the handle in order to find the name of the element.

    Hare krishna

    Hi Amit,

    Y at - it notice, that we can use to find data files belong to the backup piece.

    In fact, you have to join the three points of view in a sql against the target:
    Select p.handle, d.name
    Of
    v$ element_sauvegarde p,.
    v$ backup_datafile bd.
    v$ datafile d
    where p.handle = "& manage.
    and bd.set_stamp = p.set_stamp
    and bd.set_count = p.set_count
    and bd.file # d.file = #.
    /
    Rgds,
    Tycho

  • How to find date of creating index?

    How to find date of creating index?

    You query all_obejcts and you will find last_ddl_time when is - it has changed...

  • y at - it sites to find dates and the drivers, windows 7

    is there free online sites to find dates and pilots.

    running windows 7

    Thank you

    The best place is the manufacturer of your computer - try first. They should provide free drivers for the supported versions of Windows.

    You can also try the individual hardware components manufacturers. For example, NVidia, AMD and Intel for graphics cards. In general, this should be free.

    I would recommend avoiding utilities part 3rd pilot and Web sites, especially ones that cost money. It is usually unnecessary to use. He peut also have concerns quality and/or safety with some of them.

    Windows Update can also provide drivers for some hardware. There is no cost and no real security issues by using this method, but drivers may be generic and lacking some features.

    I prefer to install drivers when I want to and do it manually. It keeps me in control of the process and means if there is a problem it is easier to track what if its done to another more "in bulk".

  • SQL query to find the total number of source based nonsource passangersbetween source and destination station and passenger station on the same chekindate

    Hello

    SQL query to find the total number of source based nonsource passangersbetween source and destination station and passenger station on the same chekindate.

    Please help on this script and let me know if you need more details.

    ---

    You use a SELECT statement.  Let me know if you need more details.

  • What is the query to find the name of all applications for all EBS R12.1.3 modules?

    What is the query to find the name of all applications for all EBS R12.1.3 modules?

    With regard to:

    Mr. Shahzad Saleem

    Try:

    SELECT * FROM fnd_concurrent_programs_vl;

  • Oracle query to generate date and calculate fees

    Hi, please help me to create a query to get the end result of both tables as below

     CREATE TABLE detention_charge_slot
       (slot_no NUMBER(5),
      from_days NUMBER(10),
      to_days NUMBER(10),
      charge_amount NUMBER(10,2));
    
     INSERT INTO detention_charge_slot  VALUES (1,1,4,0);
     INSERT INTO detention_charge_slot  VALUES (2,5,9,10);
     INSERT INTO detention_charge_slot  VALUES (3,10,14,20);
     INSERT INTO detention_charge_slot  VALUES (4,15,999,25);
    
       CREATE TABLE detention_invoice
       (invoice_no NUMBER(10),
      invoice_dt DATE,
      delivery_dt DATE);
    
       INSERT INTO detention_invoice VALUES(1,'10-JAN-2015','25-JAN-2015');
    

    Where expected result 1 = Invoice_no:

    Start_date End_date Days Charge_Amount
    JANUARY 10, 2015JANUARY 13, 201540
    JANUARY 14, 201518 JANUARY 2015510
    19 JANUARY 2015JANUARY 23, 2015520
    JANUARY 24, 201525 JANUARY 2015225

    If you expect more than one line in DETENTION_INVOICE, use the following query

    WITH DATES

    AS

    (SELECT DI. INVOICE_DT + FROM_DAYS - 1 START_DATE,

    LEAST (DI. INVOICE_DT + TO_DAYS - 1, DELIVERY_DT) END_DATE.

    CHARGE_AMOUNT

    OF DCS, DETENTION_INVOICE DI DETENTION_CHARGE_SLOT

    where di.invoice_no = 1)

    SELECT start_date, end_date - + 1 days START_DATE, end_date, charge_amount

    OF DATES

  • Create the query by combining data from DBSS_Data_Model and HostModel

    Hello

    I am trying to create a dashboard with the host server list and instances of SQL Server running on the host.

    And I am interested in creating a query by combining data model of data in SQL Server (DBSS_Data_Model) and the host (Hosts) data model, say: which connects DBSS_SQL_Server_Host and host.

    I wonder if there is way to do it?

    Thank you

    Mark

    Something like this function should work:

    def physicalHost = nullqueryStatement = server.QueryService.createStatement("(Host where name = '$hostName')")result = server.QueryService.executeStatement(queryStatement)objs=result.getTopologyObjects()
    
    if (objs != null && objs.size() > 0) {     physicalHost = objs.get(0)}return physicalHost
    

    When the input parameter "hostName" is DBSS_SQL_Server_Host.physical_host_name

    Kind regards

    Brian Wheeldon

  • query to display data in table with several detail table

    Hi all

    I have a few cases with a table header that have more than 3 table of detail, and I have to generate the query to show all the data horizontally.

    tblHdr have column A (PK)

    tblDtl1 have column A (FK), B (PK)

    tblDtl2 have column A (FK), C (PK)

    tblDtl3 have column A (FK), D (PK)

    and I need a query to display data like this:

    AB1C3D1
    AB2C4D2
    AC5D3
    AC6

    all the Details of the table should display data based on the relationship of tblHdr (A).

    tblDtl1 have only 2 rows of data for the FK A

    tblDtl2 just for FK 4 lines of data

    tblDtl3 only 3 lines of data for the FK A

    Another example:

    AB1C1D1
    AB2C2
    A

    B3

    tblDtl1 only 3 lines of data for the FK A

    tblDtl2 have only 2 rows of data for the FK A

    tblDtl3 have only 1 rows of data for the FK A

    Please shed some light. for the record, I'll use this query in ADF, so I'll put using PLSQL in second priority.  I prefer to do it in the SQL query.

    Thank you

    Here are 3 ways. First test of data:

    drop table ta purge;
    create table ta as
    SELECT 'A' AS A FROM dual
    union all
    select 'B' from dual;
    
    drop table tb purge;
    create table tb as
    SELECT 'A' AS A, 'B1' AS B FROM dual
    UNION ALL
    SELECT 'A', 'B2' FROM dual ;
    
    drop table tc purge;
    create table tc as
    SELECT 'A' AS A, 'C1' AS C FROM dual
    UNION ALL
    SELECT 'A', 'C2' FROM dual
    UNION ALL
    SELECT 'A', 'C3' FROM dual
    UNION ALL
    SELECT 'A', 'C4' FROM dual ;
    
    drop table td purge;
    create table td as
    SELECT 'A' AS A, 'D1' AS D FROM dual
    UNION ALL
    SELECT 'A', 'D2' FROM dual
    UNION ALL
    SELECT 'A', 'D3' FROM dual;
    

    Now 3 solutions: full join, group by and pivot:

    with b as (
      select a, b,
      row_number() over(partition by a order by b) rn
      from tb
    )
    , c as (
      select a, c,
      row_number() over(partition by a order by c) rn
      from tc
    )
    , d as (
      select a, d,
      row_number() over(partition by a order by d) rn
      from td
    )
    select a, b, c, d
    from ta left join b using(a)
    full join c using(a, rn)
    full join d using(a, rn)
    order by a, rn;
    
    select a, max(b) b, max(c) c, max(d) d
    from (
      select a, null b, null c, null d, 1 rn
      from ta
      union all
      select a, b, null, null,
      row_number() over(partition by a order by b) rn
      from tb
      union all
      select a, null, c, null,
      row_number() over(partition by a order by c) rn
      from tc
      union all
      select a, null, null, d,
      row_number() over(partition by a order by d) rn
      from td
    )
    group by a, rn
    order by a, rn;
    
    select A,B,C,D from (
      select 'A' tab, a, null val, 1 rn from ta
      union all
      select 'B' tab, a, b,
      row_number() over(partition by a order by b) rn
      from tb
      union all
      select 'C' tab, a, c,
      row_number() over(partition by a order by c) rn
      from tc
      union all
      select 'D' tab, a, d,
      row_number() over(partition by a order by d) rn
      from td
    )
    pivot(max(val) for tab in('B' B, 'C' C, 'D' D))
    order by a, rn;
    
    A B C D
    A B1 C1 D1
    A B2 C2 D2
    A C3 D3
    A C4
    B

    Personally, I would prefer to view the data by using a 'join the union', in order to avoid the impression that the different detail records are related somehow.

    select ta.a, b, c, d
    from tb full join tc on 1=0
    full join td on 1=0
    right join ta on ta.a in (tb.a, tc.a, td.a);
    
    A B C D
    A B1
    A B2
    A C1
    A C2
    A C3
    A C4
    A D1
    A D2
    A D3
    B

Maybe you are looking for

  • Why force Firefox fans to download from Google store game?

    This seems blatant cronyism. Why in the world would limit Firefox downloads Google Play or "marketplaces"? Come on guys! You know that's absurd! Everyone wants Google snooping on offer of the Romans the apk somewhere else!

  • Cloning of a Mac mini with application Server

    We bought a condo in Florida and I want to my server it doubles. I use Mac mini (2 different models) with 2 drives external (one for Time Machine backups) and one for data. What is the best way to install the Apple Server on Florida related to the Ma

  • Uprgrading want 23-d010 EA

    Dear Sirs I bought this: Like 23-d010 ea It works perfectly, but now I need an upgrade. I want to add more memory and a better video card, given that the one I have is underperforming. I am an engineer, it wouldn't be hard to change, but I do not kno

  • Satellite Pro L300 - CD burning problem

    I recently bought a Satellite Pro L300 laptop and I have problems with the CD's I created. Any software I use Nero, Toshiba etc I still get the same problem. The created disc will play on the laptop, but not in my home Hi-Fi, the reader will recogniz

  • Looking for accessories for a Satellite L655D-S5151

    I'm looking for some accessories for my Satellite L655D-S5151. The newsletter that Toshiba continues to send to me is always on new laptops. I don't need a new laptop that I just bought it. I need accessories for the one I have. Now I'm looking for t