XSL transformation - distinct values

Hello

I have a XML code that is needed using XSL, I think that this can be done using distinct values, however, I have no luck in getting this work. Could someone guide me on what function use. Any guidance / help is greatly appreciated.

Here is the XML source, this scenario is that there are two different products, delivered in a box
<p:Items>
    <p:Item ItemID="12">
      <p:ProductID>123456</p:ProductID>
      <p:Quantity>1</p:Quantity>
      <p:NetPrice>12</p:NetPrice>     
      <p:Packages>
        *<p:Package BoxID="1">*
          <p:Quantity>1</p:Quantity>
          *<p:TrackingNumber>12345678910111213</p:TrackingNumber>*
        </p:Package>
      </p:Packages>
    </p:Item>
     <p:Item ItemID="12">
      <p:ProductID>1400</p:ProductID>
      <p:Quantity>1</p:Quantity>      
      <p:NetPrice>10</p:NetPrice>      
      <p:Packages>
        *<p:Package BoxID="1">*
          <p:Quantity>1</p:Quantity>
          *<p:TrackingNumber>12345678910111213</p:TrackingNumber>*
        </p:Package>
      </p:Packages>
    </p:Item>     
 </p:Items>
The XML has to be converted to,
 <ns2:package_Data>
            *<tns:package_id>1</tns:package_id>*
            <tns:package_Items>
               <tns:vendor_item_number>123456</tns:vendor_item_number>
               <tns:quantity_shipped>1</tns:quantity_shipped>
            </tns:package_Items>
               <tns:package_Items>
               <tns:vendor_item_number>1400</tns:vendor_item_number>
               <tns:quantity_shipped>1</tns:quantity_shipped>
            </tns:package_Items>
            *<tns:trackingNumber>12345678910111213</tns:trackingNumber>*
</ns2:package_Data>
If two different products is shipped in 2 different boxes, which will have two box ID and Tracking # the source XML would look like this.
<p:Items>
    <p:Item ItemID="12">
      <p:ProductID>123456</p:ProductID>
      <p:Quantity>1</p:Quantity>
      <p:NetPrice>12</p:NetPrice>     
      <p:Packages>
        *<p:Package BoxID="1">*
          <p:Quantity>1</p:Quantity>
          <p:TrackingNumber>12345678910111214</p:TrackingNumber>
        </p:Package>
      </p:Packages>
    </p:Item>
     <p:Item ItemID="12">
      <p:ProductID>1400</p:ProductID>
      <p:Quantity>1</p:Quantity>      
      <p:NetPrice>10</p:NetPrice>      
      <p:Packages>
        *<p:Package BoxID="2">*
          <p:Quantity>1</p:Quantity>
          <p:TrackingNumber>12345678910111215</p:TrackingNumber>
        </p:Package>
      </p:Packages>
    </p:Item>     
 </p:Items>
The transformed XML should look like this,
 <ns2:package_Data>
            *<tns:package_id>1</tns:package_id>*
            <tns:package_Items>
               <tns:vendor_item_number>123456</tns:vendor_item_number>
               <tns:quantity_shipped>1</tns:quantity_shipped>
            </tns:package_Items>
            *<tns:trackingNumber>12345678910111214</tns:trackingNumber>*
</ns2:package_Data>
<ns2:package_Data>
            *<tns:package_id>2</tns:package_id>*
            <tns:package_Items>
               <tns:vendor_item_number>1400</tns:vendor_item_number>
               <tns:quantity_shipped>1</tns:quantity_shipped>
            </tns:package_Items>
            *<tns:trackingNumber>12345678910111215</tns:trackingNumber>*
</ns2:package_Data>
Here is the XSL code, I tried to use different values in the for-each leading to the error, the code below works fine for the second scenario mentioned above.
 <xsl:for-each select="/ns0:OrderStatus/ns0:Items/ns0:Item/ns0:Packages/ns0:Package">
            <ns2:package_Data>
              <tns:package_id>
                <xsl:value-of select="@BoxID"/>
              </tns:package_id>
              <tns:package_Items>
                <tns:vendor_item_number>
                  <xsl:value-of select="../../ns0:ProductID"/>
                </tns:vendor_item_number>
                <tns:quantity_shipped>
                  <xsl:value-of select="../../ns0:Quantity"/>
                </tns:quantity_shipped>
              </tns:package_Items>
              <tns:trackingNumber>
                <xsl:value-of select="ns0:TrackingNumber"/>
              </tns:trackingNumber>
            </ns2:package_Data>
          </xsl:for-each>
Thank you
Fri

Try something like this...



  
  
      
         
      
      
         
             
                 
             

See you soon,.
Vlad

Tags: Fusion Middleware

Similar Questions

  • XSL - distinct values

    Hi Vlad,

    I have a problem with the xsl transformation, if a value in the input xml file is same in same/orders multiple, unique values gets added in the same node, in the example below, I have a SKU order '2' with Qty '1' and SKU '4' with '2' quantity, so my csv file will come with 3 lines, 1 line for the lines of CODE '2' and 2 for SKU4. The output seems to add the two distinct values (such as < ns0:quantity_ordered > * 1 2 * < / ns0:quantity_ordered >) in the same node, as shown in the example below. I don't know if I'm a bad button in the Item_Data or something else,

    I believe, I do not use good condition to check the separate SKU or by using a condition for each stay, I don't know if that's the problem. I would be grateful if you could tell me the problem.

    Thank you
    VINET

    Don't know if is that the first node is 0 or 1 (there is a difference between the implementations)... There the previous does not work, try to replace [0] [1]...

    
    
      
    
    
      
    
    
      
    
    
      
    
    
      
    
    
    

    See you soon,.
    Vlad

  • Distinct values does not work.

    Hi all

    Anyone can guide me please on the distinct values.

    In my xslt to need a point to get the separate provider values.

    Here is the info-provider xml example
    <SupplierXitem><XItemSupDesc xmlns:ns3="http://xmlns.oracle.com/TSS_to_RMS/RIBXItemProcess/SupplierXitem" xmlns="http://xmlns.oracle.com/TSS_to_RMS/RIBXItemProcess/SupplierXitem"><ns3:XitemSup><ns3:supplier>101018</ns3:supplier><ns3:primary_supp_ind>N</ns3:primary_supp_ind><ns3:XitemSupCtydesc><ns3:origin_country_id>IN</ns3:origin_country_id><ns3:primary_country_ind>Y</ns3:primary_country_ind><ns3:unit_cost>6.000000</ns3:unit_cost></ns3:XitemSupCtydesc></ns3:XitemSup><ns3:XitemSup><ns3:supplier>101018</ns3:supplier><ns3:primary_supp_ind>N</ns3:primary_supp_ind><ns3:XitemSupCtydesc><ns3:origin_country_id>CA</ns3:origin_country_id><ns3:primary_country_ind>Y</ns3:primary_country_ind><ns3:unit_cost>7.000000</ns3:unit_cost></ns3:XitemSupCtydesc></ns3:XitemSup></XItemSupDesc></SupplierXitem>
    and my outputshould be as below

    < ns1:XItemSupDesc >
    < ns1: beg > 101018 < / ns1: beg > < ns1:primary_supp_ind > N < / ns1:primary_supp_ind >
    < ns1:XItemSupCtyDesc >
    < ns1:origin_country_id > NC < / ns1:origin_country_id > < ns1:primary_country_ind > Y < / ns1:primary_country_ind > < ns1: unit_cost > 7.000000 < / ns1: unit_cost > < / ns1:XItemSupCtyDesc >
    < ns1:XItemSupCtyDesc >
    < ns1:XItemSupCtyDesc > < ns1:origin_country_id > IN < / ns1:origin_country_id > < ns1:primary_country_ind > Y < / ns1:primary_country_ind > < ns1: unit_cost > 6.000000 < / ns1: unit_cost > < / ns1:XItemSupCtyDesc >
    < / XItemSupDesc >

    Here is my loigc of the xslt code

    < xsl: for each select = "fn: distinct-values($supplier/ns2:XItemSupDesc/ns2:XitemSup/ns2:supplier)" >
    "< name of xsl: variable = sΘlectionner"DistinctSupplier =" "/ >
    < ns1:XItemSupDesc >
    < ns1: beg >
    "< xsl: value-of select =". "/ >
    < / ns1: beg >
    < ns1:primary_supp_ind >
    "< xsl: value-of select ="... /NS2:primary_supp_ind "/ >"
    < / ns1:primary_supp_ind >
    < ns1:vpn >
    < xsl: value-of select = "/ ns1:XItemDesc / ns1:XItemSupDesc / ns1:vpn" / >
    < / ns1:vpn >
    "< xsl: for-each select =".. ">
    < xsl: if test = "ns2: beg = $DistinctSupplier" >
    < ns1:XItemSupCtyDesc >
    < ns1:origin_country_id >
    < xsl: value-of select = "ns2:origin_country_id" / >
    < / ns1:origin_country_id >
    < ns1:primary_country_ind >
    < xsl: value-of select = "ns2:primary_country_ind" / >
    < / ns1:primary_country_ind >
    < ns1: unit_cost >
    < xsl: value-of select = "ns2: unit_cost" / >
    < / ns1: unit_cost >
    < / ns1:XItemSupCtyDesc >
    < / xsl: if >
    < / xsl: foreach >
    < / XItemSupDesc >

    I went to couple of solution in the forum about distinct values, but I could do that I get the error of execution as below
    XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc('xsl/Trans_Soa_Supplier_XitemDesc.xsl', $XitemDesc, 'supplier', $supplier). The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: XML-22900: (Fatal Error)
    It would be great if someone help me

    Kind regards
    Tarak.

    Hi Tarak,

    Tips weren't bad... You're quite the right direction...

    The code below works for sample entry you posted before... I tested here http://xslttest.appspot.com/

    Hope you give me a few points for my answers...

    
         
              
              
                   
                        
                        
                             
                                  
                             
                             
                                  
                             
                             
                                  
                                       
                                            
                                       
                                       
                                            
                                       
                                       
                                            
                                       
                                  
                             
                        
                   
              
         
    
    

    See you soon,.
    Vlad

  • Help about the XSl transformation

    I have a xml like this

    <? XML version = "1.0"? >

    <? XML-stylesheet type = "text/xsl" href = "st.xsl"? >

    workflows <>

    < completed workflow = "COMPELETED" Name = "CRMODWF6027" >

    < action >

    < completed = 'COMPELETED"Name ="SendMailAction">

    Notification of < type > < / Type >

    < / action >

    < / actions >

    < / workflow >

    < completed workflow = 'INCOMPLETE' Name = "CRMODWF6028" >

    < action >

    < completed = 'COMPELETED"Name ="UpdateValueAction">

    Update < type > values < / Type >

    < / action >

    < completed = 'INCOMPLETE' Name = "WaitAction" >

    Action not supported < type > < / Type >

    not SUPPORTED for < error > < / error >

    < / action >

    < / actions >

    < / workflow >

    < completed workflow = 'INCOMPLETE' Name = "CRMODWF6000" >

    < error > an error has occurred during the recording of the workflow

    C:\temp\Log\ErrorImages\CRMODWF6000_1400655809602.PNG < ErrorFile > < / ErrorFile >

    < / error >

    < / workflow >

    < completed workflow = 'INCOMPLETE' Name = "CRMODWF6022" >

    unsupported AccountAddress < error > record type < / error >

    < / workflow >

    < / workflows >

    I wrote like this transformation

    <? XML version = "1.0" encoding = "UTF-8"? >

    < xsl: stylesheet version = "1.0".

    "xmlns: xsl ="http://www.w3.org/1999/XSL/Transform">".

    < xsl: template match = "/" >

    < html >

    < body >

    File of the workflow log < h2 > < / h2 >

    < table border = "1" >

    < tr bgcolor = "#9acd32" >

    name of the workflow < th > < /th >

    State of the workflow < /th > < th >

    < /th > < th > workflow error

    < /tr >

    < xsl: for-each select = "Workflows/Workflow" >

    < b >

    < td > < xsl: value-of select="@Name"/ > < table >

    < td > < xsl: value-of select="@Completed"/ > < table >

    < td > < xsl: value-of select = "Error" / > < table >

    < table border = "1" >

    < xsl: for-each select = "Actions/Action" >

    < b >

    < td > < xsl: value-of select="@Name"/ > < table >

    < td > < xsl: value-of select="@Completed"/ > < table >

    < td > < xsl: value-of select = "Type" / > < table >

    < td > < xsl: value-of select = "Error" / > < table >

    < /tr >

    < / xsl: foreach >

    < /table >

    < /tr >

    < / xsl: foreach >

    < /table >

    < / body >

    < / html >

    < / xsl: template >

    < / xsl: stylesheet >

    How to turn like that

    OP: level of workflow to

    Name of the workflow
    State of the Workflow
    Workflow error message



    Depending on the status that we can probably do an outstanding CLOTH.

    Red: Status incomplete = with Error Message not as "unsupported %.

    AMBER: Status incomplete = with Error Message like "unsupported %.

    Green: Status = completed

    Down: at the level of the workflow Action

    Name of Worklfow
    Name of the action
    Type of action
    Status of the action
    Incorrect user action





    Here, too, we can do a RAG encoding:

    Green: Status = completed

    AMBER: Status = incomplete and type = Action not supported

    Red: Rest all

    Thank you

    Delphine

    Such a feature is generally known as grouping in xslt 1.0 where often xsl: Key construction is necessary to effectively deal with the problem. In this case, I guess that all of the data is not very big, that we can go out with less efficiently, which could even be more "effective" in a small set of data...

    Moreover, I have to assume error and Actions are not in a kind of competition in the sense that if the error is there Actions would not, and vice versa. This is necessary in the following as construction assumes that there is error 2 and there are Action 4... In this fictional case, whether to rowspan the largest number... and that the distribution of line covering itself could be problematic as: would you rank extended error? etc.

    We clearly, it's a way to do it.

    [code]

    [/ code]

    Note that I have not rowspan error column but only the first two columns. I did the mistake and Action on equal footing... If you really want rowspan error as well, you can put some parolees more share of td involved. But under this idea and if there might be more than one error actually under workflow, we can wonder why not in this case rowspan all the Action... It would be more script and the document looks more like the work of patch!

    PS My editor of xslt is nothing special, just publishing text multi-character-encoding-ready or these ide free everyone.

  • Error XSL Transformation

    I created a text version only of my application using XSL Transformation (to respect the mandate 6102) which worked very well on my test server, but when you migrate development server, I get the error the file name, directory name or volume label syntax is incorrect.

    I rebuilt the XSL files and reapplied the XSL Transformation on the development server. I noticed that the value of the component changed 'app.includes.MM_XSLTransform.MM_XSLTransform' to 'http:.includes. "MM_XSLTransform.MM_XSLTransform", but the error identifies the line < cfinvokeargument name = "xsl" value = "... / 0_intro/intro.xsl" > as the problem. "

    Any help is greatly appreciated.

    Let's not the name of your component. Unless you have a directory named "http:", which I doubt (and I'm not even sure that semicolons are valid characters in the paths of access/names of components).

  • CPO XSL transformation to form CPSC with grid data

    Does anyone have a developed XSL transformation that ideally analysis the CPSC release as a link of Service when there a grid in it?

    For example, the CPSC Link Service data might look like:

    An Action

    123

    ...

    Some data

    SomeValue

    SomeOtherValue

    yetanothervalue

    value2

    someothervalue2

    yetanothervalue2

    So the desired output

    SomeValue

    SomeOtherValue

    yetanothervalue

    value2

    someothervalue2

    yetanothervalue2

    I have trouble getting the right select XSL when the tag is something like ' DictionaryWithGrid-#. Field '.

    Thank you!

    Try this...



    "" xmlns: xsl = "http://www.w3.org/1999/XSL/Transform"
    xmlns: msxsl = "" urn: schemas-microsoft-com: XSLT ">"


     


         
           
         

     


       
        
       
       
         
           
             
               
               
                 
               

             

           

         

          
         
           
         

       

        
     

     

  • Show only distinct values in narrative mode

    Hi guys!

    Here again, we are trying to reach an ambitious goal.

    It is possible to show only distinct values in a narrative view? For example, I have a query that retrieves about 100 lines. In these lines, a few different years, it is something like this:

    1-2013, Jhon, 10

    2-2013, Brian, 15

    3-2013, Pete, 20

    ...

    10-2014, Steve. 5

    11-2014, Kevin, 12

    ...

    90-2015, Ray, 24

    91-2015, Michael, 2

    ...

    It is possible a mode display narrative only something like that?

    Years: 2013, 2014, 2015

    If I use the feature number @column, I get as many years the results are retrieved. It is not user friendly.

    Any help will be appreciated.

    Best regards

    Fabian

    Hi all!

    I found my own solution and I want to share with you. Maybe it helps someone in the future.

    I used JavaScript to iterate through each row value. By each line, I'll check if it value is added to the overall picture with unique values. If not added, I add it, otherwise, I do nothing.

    Here is my script (pay attention to each code block, it must be in its proper "narrative class"):

    Narrative section prefix

  • OPV with distinct values for the guests

    Hi all

    Could you get it someone please let me know where/what I'm wrong. I created the couple of OPV to get distinct values, as I can't use the view that has millions of data to load guests.

    These OPV is not directly attached to my main table but joined someother tables; After you add the guests in the responses, is to show the below error

    [nQSError: 14070] can't find coverage source logical table to the columns of the logic: [bp Manager]. Please check more detailed level keys are correctly mapped. (HY000)

    I wan to the OPV use only for guests and pass the values to help requested on the main table filters

    I have no warnings/errors in my model. What could be the problem? Thank you for your time

    REDA

    Just go with PSV.

    Check it cool - bi.com for "what happens when we select all the column values.

    Table x got to join the only 1OPV then how can you expect comes from BI to the other 2 open-pollinated varieties? Likewise, we cannot write query!

    If you can create a domain for each OPV then proceed with a command prompt with the UNION of 3 open-pollinated varieties clause

  • you place your order in xquery-distinct values

    I was surprised to see the return of the following different results, is this a bug in the XML Query rewrite, or is the order of not only guaranteed the distinct values?

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > SELECT XMLQUERY)

    2 ' (string code points

    3 distinct-values ((99,98,97)))'

    4 ELECTION CONTENT) result

    5 FROM dual;

    RESULT

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

    ABC

    SQL > SELECT / * + NO_XML_QUERY_REWRITE * /.

    () 2 XMLQUERY

    3 ' (string code points

    distinct-values ((99,98,97))) 4'

    5 ELECTION CONTENT) result

    6 FROM dual;

    RESULT

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

    CBA

    SQL >

    Hello

    The specs say the order is "dependent application": fn: distinct values

    Summary so is (I guess), strict language point of view, should not rest on any apparent order in the resulting sequence.

    The results collected by the two queries probably be different for the same reason: different implementation.

    First one with XQuery Rewrite active is solved using the SQL operators and functions, something along these lines:

    SELECT 'CODEPOINT2STR_FUNC' ('SEQUENCE')

    DE)

    SELECT 'AGGREGATE_FUNC' (VALUE (T) SEPARATE) "SEQUENCES".

    TABLE ("SEQUENCE_FUNC"(99, 98, 97)) T

    ) ;

    While the second is evaluated by the XVM and apparently maintains the original order.

  • Return distinct values in a fuction

    Hi all

    I create a function, where it must take two parameters of the input string and return the distinct values of the two channels

    input parameters are: 2.71A2, 2.71X15, 2.71x15 and 2.71A2, 2.71X15, 2.71a2

    I get the output as 2.71A2 parameters, 2.71X15

    need to convert lower case to upper case and compare.

    post needed more information.

    Thank you.

    One way is:

    Select listagg (ds, ",") the Group (control 1)

    from (select distinct superior (REGEXP_SUBSTR (s, "[^,] +', 1, rownum")) ds)

    from (select '2.71A2, 2.71X15, 2.71x15, 2.71A2, 2.71X15, 2.71a2's)

    the double)

    connect by INSTR (s, ',', 1, level - 1) > 0

    and prior sys_guid() is not null)

    Another way xmlquery

    ----

    Ramin Hashimzade

  • Error: "... isn't a table...". "XML is not correctly interpreted after the XSL transformation. Problem of quantity of line table.

    Hey guys, it's one of my xml elements:

    Jaspreet Sohi 12 18 Juliane Lenz 11 17 Sophie Charlotte Stender 10 15 Rosbeh Hamidzadeh Khayyat 12 17 Lion Stoldt 12 17 Poles Lucas Meincke 6 8 Bero Luke Vincent Ernst 6 8 Cedric Roth 6 8 Soner Cantay 6 8 the following XSL Transformation tags I use once to turn all "m" tags and one to transform all 'j '. Please, imagine the CSL-code below to reproduce exactly. Only the 'young' - table - Tag are replaced by "Mädchen" and all BROKEN underscore characters are replace by _m. like all the "select =" j [@...] "." "have been replaced by" select = "m [@...]". " ". 1 2 3 the code is very easy to live I think and not difficult to understand. As I said, I use it twice - for two transformations. The very, very strange thing, my problem is that a transformation works perfectly in InDesign and a table is created for all 'kategorie' - tags (everything is located in a foreach loop). But the second script does not work! Simply, I don't get it I can't understand. I tried more than anything. InDesign ISC (in German, translated so hypothesis based on) 'young is an invalid table element or is displayed in the wrong order. The second strange thing is that I can replace my attribute "aid: trows ' by a number, for example '10' and immediately the script works very well (there are never more than 6 'j'" tags in my XML so that the table is never more than 6 rows "). But it does not work properly with the real number, my variable "rows_j". These are my variables: they are all defined before the tables for m and j are created. So finally, why (the devil) is a table created and performed perfectly while the second - in the aftermath of the first in the XSL.script as a replica of the first - causes an error? As I've already said, I really tried everything. For example, the script also works when one of the parties ' ' is deleted at random by the script. Removing one of these parts directly makes the job of script. One of my attempts to understand the thing, but it only showed that none of these pieces 'cell to end-for-each' there is an error. I'm really desperate and research before being rescued by one of you geniuses :)

    Ah, no worries. The forum software is, well, different.

    What would be better, however, would be an example of ID file, all XSLT/XLT files you use, and one bit of data exactly as you have (State before processing). ZIP upward, upload to say dropbox.com and feel free to send me a private message for the download link.

    Too often there is something different between the pasted samples by post and the real thing it is sometimes less useful LeRiz. I'll keep it private, of course. Then we can communicate via PMs or email until we can find together a solution (hopefully), and then publish that this solution is in the forum for the benefit of others.

    Thank you, Mike

  • List of distinct values-

    Hello

    I am building a list of values for a selection of a table.  I noticed that even if I do not SEPARATE in the select, at the time of the report, the LOV seems to use automatically SEPARATE.  Is this the case or should I use DISTINCT in the select?

    Thank you.

    Leah

    By definition, a value list item class will contain only distinct values.  A LOV containing an entry for each record with the value "2013" serve no real function. Being a LOV each displayed value will be unique.

    Kind regards

    Sharon

    Support of Oracle

  • saveXML does not apply to the XSL transformation

    I have a XSL I want to use to fill a 2d barcode. I put the connection of data as follows:

    However, when I call

      this.rawValue = xfa.record.saveXML();
    

    It does not apply the XSL transformation. What should I do to force the transformation? If I do an Acrobat data export operation, the resulting XML file is transformed, so I can't change my work.

    Ok. I think I have a solution. The stylesheet nodes are packages className, so using the code below:

    var oStyleSheets = xfa.resolveNodes("stylesheet[*]")
    for (var i = 0; i < oStyleSheets.length; i++) {
        if (oStyleSheets.item(i).getAttribute("id") == "XFADataInputXSL")
            console.println("got input XSL");
        else if (oStyleSheets.item(i).getAttribute("id") == "XFADataOutputXSL")
            console.println("got output XSL");
    }
    

    I can then pull out the style sheet just for work.

  • Select the records from the first n distinct values of column

    I need to write a query in plsql to select records for the first 3 values distinct from a single column (example below, ID) and all lines for the next 3 distinct values of column and so on until the end of the number of distinct values in a column.
    for example:
    Age of name ID
    1 abc 10
    1 def 20
    2 IA 10
    2 20 JKL
    2 mno 60
    3 10 pqr
    4 the RST 10
    4 10 TÜV
    5 vwx 10
    6 10 XYZ
    hij 6 10
    7 lmn 10
    .
    .
    .
    so now... (up to a few County)
    Result must be
    1 the application should result->
    Age of name ID
    1 abc 10
    1 def 20
    2 IA 10
    2 20 JKL
    2 mno 60
    3 10 pqr

    Query 2 should lead to->
    4 the RST 10
    4 10 TÜV
    5 vwx 10
    6 10 XYZ
    hij 6 10

    Query 3 should lead to->
    7 lmn 10
    .
    .
    9... ..
    so now...
    How to write a query for this inside a loop.

    Hello

    Thus, a panel will consist of the lowest id value, the 2nd lowest and the 3rd lower, reggardless of how many lines is involved. The next group will include the 4th lowest id, the 5th lowest and the 6th lowest. To do that, you must assign the numbers 1, 2, 3, 4, 5, 6,... for the rows in order by id, with all lines with the same id, getting the same number and without jumping all the numbers.
    This sounds like a job for the analytical DENSE_RANK function:

    WITH     got_grp_id     AS
    (
         SELECT     id, name, age
         ,     CEIL ( DENSE_RANK () OVER (ORDER BY id)
                   / 3
                   )          AS grp_id
         FROM     table_x
    )
    SELECT     id, name, age
    FROM     got_grp_id
    WHERE     id     = 1     -- or whatever number you want
    ;
    

    If you would care to post CREATE TABLE and INSERT statements for your sample data, then I could test it.
    See the FAQ forum {message identifier: = 9360002}

  • Select the distinct value of a column in the collection in bulk.

    Hi all

    Collecting the data of a query to a variable of type table. I need to select a separate of a perticular column value in the collection.

    Collection has followiing values inside.
    Col(c).articleid,
    Col(c).userkey,
    Col(c).origin,
    Col(c).addnlorigindata,
    Col(c).avdest,
    Col(c).dispfmt,
    Col(c).sourcecode,
    Col(c).success_ind,
    Col(c).error_code,
    Col(c).entry_createddate,
    Col(c).createdby,
    Col(c).filenumber,
    Col(c).linenumber,
    Col(c).acctnum,
    Col(c).assetkey,
    Col(c).autocompletedterm,
    Col(c).accessionnumber,
    Col(c).requestdatetime,
    Col(c).requestorip,
    Col(c).articleordinal,
    Col(c).userinitiatedind,
    Col(c).captchastatus
    I need to select distinct column values (for example: Col (c) .sourcecode) collection and the need to insert in the table if the value in this column does not exist in the table.

    Say, Col (c) .sourcecode has the value XYZ, ABC. If the "XYZ" value does not exist in the table, so I need to insert in the table and if "ABC" exists in the tables then don't insert it. (something like fusion) after seecting to the distinct values in a column in the collection.

    Thanks n regards
    Nana Akkivalli.

    The collection must be inserted before you can use this topic.

    In the Begin block, you have to collect a loose and insert inside: something like

    SELECT *
    BULK COLLECT INTO l_array
    FROM ALL_USER
    ...CONDITIONS...
    

Maybe you are looking for

  • How existing health SSD

    I'm using Macbook Pro 2011 15 "." I can replace the old new SSD HARD drive, there is nothing to do or not to do or takecare of it to existing, it is the health

  • My new update to FF 33 version is installed LOCKED in full screen and I can't get to my office

    I use a HDMI TV as a monitor. When I upgraded to ver 33.02 (?), he has locked in FULL SCREEN mode and my TV/monitor is not adjustable, so the top "EXIT FULL SCREEN" option is not displayed or available and must be deployed on the top. I cannot find a

  • HP Paviliong9 notebookpc: battery or plug in pin adapter problems

    Laptop will not load.  States of icon is connected but does not support.    Has begun charging for less than 30 seconds maybe 3 times only, then goes to not charge mode.  Up to 60percent. My Jack works the ac adapter is only lukewarm. I can't calibra

  • conflict of thread

    Hello I'm trying to set the value of the digital with the property node but conflict of thread error. The data type is passed the class is also DBL and this is an indicator that is wired on. What causes conflict wire? Thank you

  • can I remove the progam that I do not?

    Can I remove the program that came with my desktop computer?  (HpPSC & officejet 3.0) I do not use. Compaq sr1911x w/windows xp