How to flatten the sparse table records?

We have an application that (unfortunately) stores its data in a format of name-value style "long and thin", which we then rotate in "wide" for output records. We aim to do this with a materialized view, but want to use partition of the track changes to update the points of view, which imposes restrictions on the way in which we build our points of view. In particular, we cannot use subqueries or analytical functions to completely flatten the data on output files.

Right now, our materialized views to produce something like the following:

Save the key. Date of creation | Column1 | Column2 | Column3 | etc.
--------------------------------------------------------------------------------------------
REC01 | JANUARY 1, 2010 | A | B | | ...
REC01 | JANUARY 4, 2010 | C | D | ...

We need is to flatten these documents so that there is only one record with a particular registration key and only have the value non-NULL of the most recent for each ColumnN for example:

Save the key. Column1 | Column2 | Column3 | etc.
--------------------------------------------------------------------------------------------
REC01 | A | C | D | ...

The problem is that it can be hundreds of columns ColumnN, may be many different update records for a given (and), registration key so I have a problem of work how to do this b effectively or indeed (b) at all.

We can't just use the most recent Date of creation, because we will have to look at another Date of creation for each column. Because the MV should be able-PCT, it seems that we cannot use a subquery to extract only the last value for each ColumnN before spinning the data, and I do not see how to apply a group or an analytical function for this reliable on recordings of wide in view to.

We need is a sort of FLATTEN() OVER (PARTITION BY RecordKey ORDER BY DateCreated DESC) function, but Oracle unfortunately seems to be missing in this regard. Or am I missing something?

Looking at the data, it seems that it should be simple enough, but my brain-SQL is running out of juice, so if someone else can suggest how to approach the issue, I would be very grateful.

Thank you
Chris

There is probably a way simpler than that, but it's early in the morning and I don't wake even...

SQL> ed
Wrote file afiedt.buf

  1  with t as (select 'REC01' as record_key, to_date('01-JAN-2010','DD-MON-YYYY') as date_created, 'A' as column1, 'B' as column2, null as column3 from dual union all
  2             select 'REC01', to_date('04-JAN-2010','DD-MON-YYYY'), null, 'C', 'D' from dual union all
  3             select 'REC02', to_date('06-JAN-2010','DD-MON-YYYY'), 'X', null, 'Z' from dual)
  4  -- end of test data
  5  select record_key, date_created, column1, column2, column3
  6  from (
  7        select record_key
  8              ,last_value(date_created) over (partition by record_key order by date_created) as date_created
  9              ,last_value(column1 ignore nulls) over (partition by record_key order by date_created) as column1
 10              ,last_value(column2 ignore nulls) over (partition by record_key order by date_created) as column2
 11              ,last_value(column3 ignore nulls) over (partition by record_key order by date_created) as column3
 12              ,row_number() over (partition by record_key order by date_created desc) as rn
 13        from t
 14       )
 15* where rn = 1
SQL> /

RECOR DATE_CREATED        C C C
----- ------------------- - - -
REC01 04/01/2010 00:00:00 A C D
REC02 06/01/2010 00:00:00 X   Z

SQL>

Tags: Database

Similar Questions

  • How to find the most recent record?

    How to find the most recent record?

    Hello

    It is part of our Bill the elements table, retrieved by the following query:

    SELECT movimento, dt_movimento, cd_material,
    cd_tp_operacao, nf, series,
    sole, pr_unitario
    Of itemfat
    WHERE cd_material IN ('722136', '759177', ' 810725', 818848')
    AND cd_tp_operacao ("' 1102 c ' ', ' 2102 C")
    ORDER BY cd_material,
    dt_movimento


    MOVIMENTO DT_MOVIMENTO CD_MATERIAL CD_TP_OPERACAO NF SERIES AS PR_UNITARIO
    2008-03-11 2137625, 722136 2102 1084738 3 120 2 915
    2588890 08/05/2008 722136-2102 1090987 3 120 2,5615
    755522 09/10/2007 759177-2102 101449 1 200 0.6
    701055 03/10/2007 810725-2102 1013865 1 36 10.9
    1588804 20/12/2007 810725 2102 1014182 1 96 10.9
    1305653 03/12/2007 818848-2102 108555 1 240 6.5
    3102134 07/18/2008 818848 2102 109784 1 360 6.5


    Seems that I whant to retrieve only the most recent records for each item, as:

    MOVIMENTO DT_MOVIMENTO CD_MATERIAL CD_TP_OPERACAO NF SERIES AS PR_UNITARIO
    2588890 08/05/2008 722136-2102 1090987 3 120 2,5615
    755522 09/10/2007 759177-2102 101449 1 200 0.6
    1588804 20/12/2007 810725 2102 1014182 1 96 10.9
    3102134 07/18/2008 818848 2102 109784 1 360 6.5


    Can someone help me with a sentece SQL to do?

    Thanks in advance.

    You can certainly do it:

    SELECT   movimento, dt_movimento, cd_material, cd_tp_operacao, nf, serie,
             quantidade, pr_unitario
        FROM itemfat i
       WHERE cd_material IN ('722136', '759177', '810725', '818848')
         AND cd_tp_operacao IN ('1102C', '2102C')
         AND dt_movimento =
                (SELECT MAX (dt_movimento)
                   FROM itemfat d
                  WHERE d.cd_material = i.cd_material
                    AND d.cd_material IN ('722136', '759177', '810725', '818848')
                    AND d.cd_tp_operacao IN ('1102C', '2102C'))
    ORDER BY cd_material, dt_movimento
    

    : p

  • How to read the color table in a subvi?

    How to read the color table in a subvi? Is it made by a reference to the table or with a global variable? For a better understanding of the problem, I added to vi. Run the "run.vi." I want to see

    the background color of the table "run.vi" in the subvi called "read color.vi".

    How can I do?

    Thanks in advance

    Norick

    pop up on the wire table refernece and establishes 'control '. Add this control to the icon of the sub - VI decision-making and then wire ref of the appellant to this Terminal VI so the calling VI move the ref to the Subvi.

    Ben

  • How to configure the partition table for SSD?

    Drive: 32 GB SSD

    I accidentally delete without backup partition table information and would like to know how to put the partition table, I can access the tools of partition table, but do not know how to define.

    Does anyone have any suggestions?

    Thanks in advance for your suggestions

    Hello

    Thanks for posting your query in Microsoft Community.

    The SSD could be seen in the disk management window, and you could name and set up as another hard drive internal. To create a partition or volume on a hard disk, you must be logged in as an administrator, and there must be unallocated disk space or free space in an extended hard disk partition. To repartition your hard drive, please consult the following link and check if it helps.

    I can I repartition my hard disk?

    Additional information:

    Create a new Partition on a hard disk in Windows 7

    Hope this information is useful. Let us know if you need more help, we will be happy to help you.

  • How to create the logical tables & how to give joints according to obiee 11g?

    Hello

    I have again to obiee 11g. I want to create the logical tables in MDB layer.

    After that I want to give joins according to MDB.

    I don't know, how to create the logical tables and how to give joints according to obiee 11g?

    Please help me.

    Thanks in advance,

    A.Kavya

    Hello

    The new logical table is right click on the MDB itself, for the join you generally in the business model diagram (again right click on objects).

    Maybe it's better if you start from a kind of tutorial to at least have an overview of what is happening where (layer business and physical layer etc.).

    Take a look at what Oracle has available: Oracle BI EE 11 g

    And no doubt, it can be a good start: https://apexapps.oracle.com/pls/apex/f?p=44785:24:0:NO:P24_CONTENT_ID, P24_PREV_PAGE:9787, 2

  • How to get the underlying tables

    Hi all

    EBS R12.2

    How can I get the underlying tables of the following form?

    Capture.PNG

    Thank you very much

    Jen

    Hello

    Go to help-> review-> properties-> point.

    That's how you get the base table (FND_USER_RESP_GROUPS_INDIRECT):

    Kind regards

    Bashar

  • How know what the largest table of my oracle database?

    How know what the largest table of my oracle database?

    SELECT * FROM
    (
    SELECT
    NOM_SEGMENT,
    SEGMENT_TYPE,
    BYTES/1024/1024 MB
    TABLESPACE_NAME
    Of
    DBA_SEGMENTS
    WHERE
    SEGMENT_TYPE = 'TABLE '.
    ORDER BY DESC 3
    )
    WHERE
    ROWNUM<=>

  • How to mark the physical tables as "cacheable"

    Hi all

    Can someone tell me please how to mark the physical tables as "cacheable".

    Thnaks a lot

    You can make cacheable table by clicking twice on the table or go to the properties of the table. You can designate specific time duration for the year, month, days need to keep cacheable. Remember do this on the base tables will affect all alias tables.

    Thank you
    Amol

  • How to recover the deleted table

    Hai

    How to recover the deleted table

    the IMP log = = file tables =

    fromuser =' 'touser =' '
    are you new on s/n? (Sorry for the request this because you asked the steps to import a single table). If you read the docs of oracle, you would have not asked this question

    Kind regards
    Pavan
    http://pavandba.WordPress.com

  • How to avoid the second NULL records table using the join

    I followed two tables:

    Name of the table: Emp
    EmpNo EmpName salary Dept DeptLocation
    1 Lar 1000 1
    2 Dai 2 2000
    3 mar 3 3000
    4 Apr 4000 4 NULL

    Name of the table: Dept
    DeptNo DeptName DeptLocation
    1 HR A
    2 Dev B
    2 Dev NULL
    3 test NULL
    NULL terminator 4


    I try to get following result:
    EmpNo EmpName salary DeptName DeptLocation
    LAR 1000 1 HR has
    2 Dai 2000 Dev B
    March 3 3000 Test C
    4 Apr 4000 end NULL


    Rules:
    -Get all matching records from Emp & the DeptNo from Dept
    -If the Dept table has more entries for the same DeptNo then consider records with DeptLocation is not NULL and avoid the record with DeptLocation with NULL value
    -Get all records matching Emp & Dept from the DeptNo where DeptLocation is NULL and exist only once in Dept


    Thanks in advance for your suggestions.

    Hello

    So when deptlocation is in the two tables, but not the same thing, you want to take the value of the table emp, not the dept table.

    In this case, reverse the NVL arguments:

    WITH     got_rnk          AS
    (
         SELECT     deptno, deptname, deptlocation
         ,     DENSE_RANK () OVER ( PARTITION BY  deptno
                                   ORDER BY          NVL2 ( deptlocation
                                                  , 1
                                       , 2
                                       )
                           )     AS rnk
         FROM    dept
    )
    SELECT     e.empno
    ,     e.empname
    ,     e.salary
    ,     r.deptno
    ,     r.deptname
    ,     NVL ( e.deptlocation          -- Changed
             , r.deptlocation          -- Changed
             )          AS deptlocation
    FROM     emp      e
    JOIN     got_rnk     r     ON     e.dept     = r.deptno
    WHERE     r.rnk     = 1
    ;
    

    Apart from the 2 marked lines "Changed", it's the same query I posted earlier.

  • parents and children of the same table records

    I want to create a query that is a union such that 2nd resultset is based on the game of results 1. I have a table that has parent and child records in the same table.

    Table: EVENTS
    EVENT_ID
    PARENT_EVENT_ID
    CREATED_DATE
    (other columns)

    If PARENT_EVENT_ID is null, then this is a parent record, otherwise it is a book of the child. I want to select all parent records then union them with all the related child records... something like this:

    Select * from EVENTS where CREATED_DATE < sysdate - 90 and PARENT_EVENT_ID is null - all parents
    Union
    Select * event where PARENT_EVENT_ID in (select EVENT_ID of EVENTS where CREATED_DATE < sysdate - 90 and PARENT_EVENT_ID is null)-include all children selected from the top parent

    It works but it of kind of ugly, I want to avoid using the subselect in the 2nd because it is a repeat of the 1st statement, is there a way to alias the first statement and only refer to him in the 2nd query?

    Hello

    CONNECTION is very similar to a UNION on the same table. How is this:

    SELECT     *
    FROM     events
    WHERE     created_date     < SYSDATE - 90
    START WITH     parent_event_id     IS NULL
    CONNECT BY     parent_event_id     = PRIOR event_id
         AND     LEVEL          <= 2    -- Maybe
    ;
    

    ?

    To answer your question: Yes, you can still keep the result set of a query and the Treaty as if it were a table or vew, like this:

    WITH     roots     AS
    (
         SELECT     *
         FROM     events
         WHERE     created_date     < SYSDATE - 90
         AND     parent_event_id     IS NULL
    )
    SELECT     *
    FROM     roots
         --
    UNION ALL
            --
    SELECT     *
    FROM     events
    WHERE     created_date     < SYSDATE - 90
    AND     parent_event_id     IN (
                          SELECT  event_id
                          FROM    roots
                      )
    ;
    

    It's always a bit ugly, however. I would use CONNECT BY or from Oracle 11.2, a recursive WITH clause (which is explicitly a UNION), or, in any version, a self-join, like this:

    SELECT     c.*
    FROM          events  c
    LEFT OUTER JOIN     events     p  ON   p.event_id  = c.parent_event_id
    WHERE   p.parent_event_id  IS NULL
    ;
    

    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.
    Report where the queriy above (the one you decide to use) is producingthe bad results and explain, using specific examples, how you get the right results from these data in these places.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • How to keep the text tables moves from DW to outlook?

    I am do an e-mail Blast, then inserting in our e-mail sender and to test it in outlook, it moves the right of the text table, so it's really long and can't rest not as set width and height, I thought I put it in the code.

    Here is the code:

    <! doctype html >

    < html >

    < head >

    < meta charset = "utf-8" >

    < title > Untitled Document < /title >

    < style type = "text/css" >

    HTML, body, div, span, applet, object, iframe,

    H1, h2, h3, h4, h5, h6, p, blockquote, pre,

    a, abbr, acronym, address, big, cite, code,

    del, dfn, em, img, ins, kbd, q, s, samp,

    small, strike, strong, sub, sup, tt, var,

    b, u, i, Center.

    DL, dt, dd, ol, ul, li,

    fieldset, form, label, legend,.

    table, caption, tbody, tfoot, thead, tr, th, td,

    Article, aside, canvas, details, embed,

    Figure, figcaption, footer, header, hgroup,

    menu, nav, output, ruby, section, summary,

    time, mark, {audio, video

    margin: 0;

    padding: 0;

    border: 0;

    do-size: 100%;

    font: inherit;

    vertical-align: baseline;

    }

    do {}

    do-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida without", "DejaVu without ', Verdana, without serif.

    do-size: 12px;

    text-align: left;

    }

    .title {}

    do-family: Segoe, "Segoe UI", "DejaVu without", "Trebuchet MS", Verdana, without serif.

    do-size: 18px;

    do-variant: normal;

    make-weight: normal;

    }

    . Bold {}

    do-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida without", "DejaVu without ', Verdana, without serif.

    make-weight: bold;

    }

    . Border {}

    background-color: #FFF;

    border: thick solid #000;

    }

    . LinkColor {}

    color: #609;

    do-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida without", "DejaVu without ', Verdana, without serif.

    }

    table {}

    margin: 0px;

    padding: 0px;

    border-top-width: 0px;

    border-right-width: 0px;

    border-bottom-width: 0px;

    border-left-width: 0px;

    border-top-style: none;

    border-right-style: none;

    border-bottom-style: none;

    border-left-style: none;

    }

    container-.text {}

    padding: 4px;

    Width: 350px;

    }

    . Container {}

    border: 8px solid #000;

    }

    {.justify}

    text-align: justify;

    }

    {.leftcontainer}

    Width: 300px;

    }

    < / style >

    < / head >

    < body >

    < table width = "741" cellpadding = "0" cellspacing = "0" style = "border: background-color: #FFF;"

    border: thick solid #000; padding: 0px; margin: 0; ">

    < tr > < td colspan = "2" style = "padding: 0px;" "" "margin: 0px ' > < img src =" http://www.Juran.com/downloads/header_.png "style =" margin: 0px; " padding: 0px; border: 0px; "/ > < table > < /tr >

    < b >

    < td valign = "top" style = "font family:"great Lucida', 'Lucida without Unicode', ' Lucida without "," DejaVu without ', Verdana, without serif; " do-size: 12px; text-align: left; padding: 0px; margin: 0px; "" "width ="327px"> < img src =" http://www.Juran.com/downloads/header_bottom.png "style =" margin: 0px; " border: 0px; padding: 0px; » />

    < div style = "padding: 4px;" Width: 350px; Width: 350px; ">

    < style p = "do-family: 'Great Lucida', 'Lucida without Unicode', ' Lucida without", "DejaVu without ', Verdana, without serif;" do-size: 12px;

    text-align: left; "> < span style =" do-family: 'Great Lucida', 'Lucida without Unicode', ' Lucida without "," DejaVu without ', Verdana, without serif; " make-weight: bold; "> more organizations rely on Juran QbD </span > and not only because the quality of design is in itself a proven methodology, but also because it is rooted in the fundamental techniques of Juran. "Recognize many eminent practitioners of Juran < a href ="http://www.amazon.com/Juran-Quality-Design-Planning-Services/dp/0029166837/ref=sr_1_1?ie=U TF8 & qid = 1374850769 & sr = 8-1 & keywords = juran + on + quality + by + design"style =" color: #609; do-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida without", "DejaVu without ', Verdana, without serif. "" > design for world class quality < /a > as the < a href = "http://www.qualitydigest.com/inside/quality-insider-column/chronology-quality-part-1.html"style ="color: #609; do-family:"Lucida Grande","Lucida Sans Unicode"," Lucida without "," DejaVu without ', Verdana, without serif. "> < /a > base to develop their innovative and creative design initiatives; don't just pale imitations. < /p >

    < style p = "do-family: 'Great Lucida', 'Lucida without Unicode', ' Lucida without", "DejaVu without ', Verdana, without serif;" do-size: 12px; text-align: left; "> < br >

    " < a href =" http://www.Juran.com/downloads/Juran_CS_EHRSchedulingandRegistration_2012.pdf "style =" color: #609; " do-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida without", "DejaVu without ', Verdana, without serif. "> click here < /a > to the deployment of QbD for a detailed case study describing Juran using DFSS in a large hospital for children, the process for planning and registration of electronic health records, greatly increased accuracy performance and patient satisfaction. < /p >

    < / div >

    < table border = "0" align = "center" >

    < b >

    " < td > < a href =" http://www.Juran.com/ "> < img src =" http://www.Juran.com/downloads/images/Juran-logo-Small.png "width ="144"height ="48"/ > < / a > < table > "

    " < td > < a href =" https://www.Facebook.com/JuranInstitute "> < img src =" http://www.Juran.com/downloads/images/FB.gif "width ="29"height ="29"/ > < / a > < table > "

    " < td > < a href =" https://Twitter.com/Juran_Institute "> < img src = ' http://www.Juran.com/downloads/images/Twitter.gif "width ="29"height ="29"/ > < / a > < table > "

    " < td > < a href =" http://www.LinkedIn.com/company/Juran-Institute "> < img src =" http://www.Juran.com/downloads/images/LinkedIn.gif "width ="30"height ="29"/ > < /a > < table > "

    " < td > < a href =" http://www.YouTube.com/user/JuranInstitute "> < img src = ' http://www.Juran.com/downloads/images/YouTube.gif "width ="29"height ="29"/ > < / a > < table > "

    < /tr >

    < /table >

    < p > < /p > < table >

    < td > < div style = "padding: 4px;" width: 350px; height: 480px; "> < style p =" do-family: 'Great Lucida', 'Lucida without Unicode', ' Lucida without "," DejaVu without ', Verdana, without serif; " do-size: 12px;

    text-align: left; "> < span style =" font family: Segoe, "Segoe UI", "DejaVu without", "Trebuchet MS", Verdana, without serif; " do-size: 18px; do-variant: normal; make-weight: normal; ' > QBD GIVES MEASURABLE RESULTS </span > < br >

    Also known as DFSS, DFLSS, DMADV and DMEDI, < span style = "do-family: 'Great Lucida', 'Lucida without Unicode', ' Lucida without", "DejaVu without ', Verdana, without serif;" "make-weight:" BOLD ";' > design quality is a structured process to develop best-in-class products that ensure your client needs are met." </span > organizations around the world move quickly from a corrective operational mindset to proactive prevention. Now, they must transition to an innovative way of thinking, to aggressively increase revenues while continuing to reduce costs. That reduction in life cycle of the products, reduce time-to-market for product is a competitive necessity. < span style = "do-family: 'Great Lucida', 'Lucida without Unicode', ' Lucida without", "DejaVu without ', Verdana, without serif;" make-weight: bold; ' > the quality of design allows businesses to meet these challenges and demands. </span > < / p >

    < style p = "font family:"great Lucida', 'Lucida without Unicode', ' Lucida without "," DejaVu without ', Verdana, without serif; " do-size: 12px; text-align: left; ' > Products and services can no longer be designed without understanding the drivers of the acceptance of the product and scalability. QbD facilitates innovation happen in designing products and processes & #8212; including controls & #8212; to produce the final output. < span style = "do-family: 'Great Lucida', 'Lucida without Unicode', ' Lucida without", "DejaVu without ', Verdana, without serif;" "make-weight:" BOLD ";' > it is essential to design output from the first time and a timely and cost-effective manner </span > < / p >"

    < style p = "font family:"great Lucida', 'Lucida without Unicode', ' Lucida without "," DejaVu without ', Verdana, without serif; " do-size: 12px; text-align: left; "> < span style =" font family: Segoe, "Segoe UI", "DejaVu without", "Trebuchet MS", Verdana, without serif; " do-size: 18px; do-variant: normal; make-weight: normal; ' > JURAN CAN DO for YOU </span > < br >

    Juran will work with your team to create the solution that best fits your needs. If you need a change of culture in the long term, a Lean Six Sigma program, or just a quickie, < span style = "do-family: 'Great Lucida', 'Lucida without Unicode', ' Lucida without", "DejaVu without ', Verdana, without serif;" "make-weight:" BOLD ";' > we will develop the best solution to fit your needs." </span > < / p >

    < style p = "font family:"great Lucida', 'Lucida without Unicode', ' Lucida without "," DejaVu without ', Verdana, without serif; " do-size: 12px; text-align: left; "> you are ready to restart, streamline processes, improve efficiency and get measurable results? If you, < span style = "do-family: 'Great Lucida', 'Lucida without Unicode', ' Lucida without", "DejaVu without ', Verdana, without serif;" "make-weight:" BOLD ";' > you're ready for Juran." </span > contact us today by telephone to the 800.338.7726, or by e-mail, < a href = "mailto:[email protected]" style = "color: #609;" do-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida without", "DejaVu without ', Verdana, without serif. ">[email protected]< /a >. < /p > < / div > < table >

    < /tr >

    < /table >

    < / body >

    < / html >

    This is how it should look (that's in DW, it has a black border all around)

    dw.JPG

    This is what it looks like when we send it in outlook to test:

    outlook.JPG

    If anyone has comments, it would be greatly appreciated!

    Thank you!

    Embedded CSS are generally deleted emails and will not work.

    Use nested tables and don't make your primary table not exceeding some 600px wide.

    HTML e-mails: what you need to know

    http://ALT-Web.com/articles/HTML-emails.shtml

    Nancy O.

  • How to reverse the 2d table

    Hello

    I have a chart 2d with this format.

    1 2 3

    4 5 6

    7 8 9

    I want to partition reverce

    1 2 3

    4 5 6

    7 8 9

    without using a loop, it is possible.using labview8.2

    Let's say that LabVIEW integrates a function to do it for you.  The underlying logic will use a loop.  Why?  Because it's a rather strange restriction put in place to prevent loops when you want to make an option that requires several almost identical iterations.

    Why are you trying to avoid using loops?

    Let's take a look at the code that can do what you ask.  Then we'll take a better look at it, and why we want to return to the question in bold?

    This will take your picture, splitting one line at a time, use the table 1 d inverse function (which will run an inner loop) on each line, build the lines in the 2D table and the output result.

    Now, what happens if you want to add a fourth row of this table 2D?  You must descend again to the same logic, wiring in the line concerned, extend the table construction, etc.  This could be something, you can manage.  But what happens if you want to extend it to a table with 100 rows?  Now, the work happens to be a little more and the code becomes essentially impossible to read.  You don't get any value here avoiding the loop.

    Let's take it a bit further.  What happens if you want to work with arrays of variable size?  Now, what will you do?  Your code is designed to work with a table size (and rather awkward doing).

    So we go back to the same question that we had this time together.  Why, exactly, you try to avoid loops?  Doing this without a loop is bad programming.  Don't limit yourself to bad practices to solve something that can easily be manipulated in a loop.  Write the code you maintain, scale and read.  If the loops are the best option, use them.  You're basically saying ' how can I use this screw if I don't want to use a screwdriver?  Of course, you can nail the it.  But stop being stupid.  Use the tool to the job.

  • How to save the e-mail records/e-mail on my computer

    I use hotmail to access my MSN account.  Would like to know how to record the e-mail records/e-mail on my computer

    Hello

    What operating system do you work?

    If the problem is specific to MSN, I suggest that you contact MSN support for assistance. Please see the following article on how to contact MSN Customer Support.

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

  • How to determine the number of records in a subquery

    I am fairly new to Oracle SQL, and would like to know if anyone has examples of how to perform the following operations:

    1. I would return the number of rows that exist in the following SQL statement below. This SQL will be part of a larger SQL statement and I will be passing in the EMPLID identifier in the subquery. The result must be a value showing the total number of records that correspond to the SQL below. "xyz" will be finally passing through the extension number of the employee by using a reference to the parent SQL... ie: jbe. POSITION_NBR
    2. My SQL:

    SELECT Cjbe. EMPLID OF PS_JOB cjbe
    WHERE cjbe. POSITION_NBR = "xyz".
    GROUP BY cjbe. EMPLID

    I would like to know how I can change the value of poarent to POSITION_NBR (I think I use jbe.) POSITION_NBR) total calls the EMPLID found in this subquery subquery and then return.

    Thanks for your help.

    Maybe I lack something, but isn't this just

    SELECT count (distinct empl_id) from ps_job where position_nbr =: some_position_nbr

Maybe you are looking for