Creating a line chart series multi with different data providers

I have 3 providers of data of the same structure that is ArrayCollection of data collection and that you want to use to create a line chart multiseriate. I don't have just 1 dataProvider that can be used but 3 different data providers of the same structure I want to use each different series.

[Bindable] private var orangeSales: ArrayCollection = collection

new ArrayCollection collection)

[{sale: 101000, month: new Date (January 1, 2008 "")},]

{sale: 960000, month: new Date (February 1, 2008 ')},

{sale: 475000, month: new Date (March 1, 2008 ')},

{sale: 425000, month: new Date (April 1, 2008 "")}

] );

[Bindable] private var appleSales: ArrayCollection = collection

new ArrayCollection collection)

[{Sales: 991000, month: new Date (January 1, 2008 "")},]

{sale: 140000, month: new Date (February 1, 2008 ')},

{sale: 565000, month: new Date (March 1, 2008 ')},

{sale: 255000, month: new Date (April 1, 2008 "")}

] );

[Bindable] private var bananaSales: ArrayCollection = collection

new ArrayCollection collection)

[{sale: 891000, month: new Date (January 1, 2008 "")},]

{sale: 147560, month: new Date (February 1, 2008 ')},

{sale: 295000, month: new Date (March 1, 2008 ')},

{sale: 574000, month: new Date (April 1, 2008 "")}

] );

I want to create a line chart with orangeSales, appleSales and bananaSales as three different lines on the graph for different specified dates.

< mx:ColumnChart showDataTips = "true" >

< mx:horizontalAxis >

< mx:CategoryAxis

dataProvider = "{orangeSales}".

categoryField = 'months '.

/ >

< / mx:horizontalAxis >

< mx:series >

< mx:LineSeries displayName = "OrangeSales" yField = "sale" xField = "month" dataProvider = "{orangeSales}" / >

< mx:LineSeries displayName = "AppleSales" yField = "sale" xField = "month" dataProvider = "{appleSales}" / >

< mx:LineSeries displayName = "BananaSales" yField = "sale" xField = "month" dataProvider = "{bananaSales}" / >

< / mx:series >

< / mx:ColumnChart >

Help, please!

Sorry for the confusion. In fact I do something wrong, such as using ColumnChart to display a line chart or something like that.

Now, I realized that a multi series line graph can be built by the presence of a different data provider for each of the LineSeries object.

If the code below would create a multi series line graph:

[Bindable] private var orangeSales: ArrayCollection = collection

new ArrayCollection collection)

[{sale: 101000, month: new Date (January 1, 2008 "")},]

{sale: 960000, month: new Date (February 1, 2008 ')},

{sale: 475000, month: new Date (March 1, 2008 ')},

{sale: 425000, month: new Date (April 1, 2008 "")}

] );

[Bindable] private var appleSales: ArrayCollection = collection

new ArrayCollection collection)

[{Sales: 991000, month: new Date (January 1, 2008 "")},]

{sale: 140000, month: new Date (February 1, 2008 ')},

{sale: 565000, month: new Date (March 1, 2008 ')},

{sale: 255000, month: new Date (April 1, 2008 "")}

] );

[Bindable] private var bananaSales: ArrayCollection = collection

new ArrayCollection collection)

[{sale: 891000, month: new Date (January 1, 2008 "")},]

{sale: 147560, month: new Date (February 1, 2008 ')},

{sale: 295000, month: new Date (March 1, 2008 ')},

{sale: 574000, month: new Date (April 1, 2008 "")}

] );

I want to create a line chart with orangeSales, appleSales and bananaSales as three different lines on the graph for different specified dates.

<>

dataProvider = "{orangeSales}".

categoryField = 'months '.

/>

Tags: Flex

Similar Questions

  • to join two columns with different data types

    Hello experts,

    I have two tables...
         create table1
       (
         col1 varchar2(20)
        );
        
      create table2
        (
          col1 number(10)
        );  
    
      
    with their data as below
              with table1 as
      (  select 'xx' col1 from dual union all 
         select 'yy' col1  from dual union all
         select '01' col1  from dual union all
         select '02' col1  from dual union all
         select '03' col1  from dual union all
         select '04' col1  from dual 
      ),table2 as 
       (
         select '01' col1 from dual union all
         select '02' col1 from dual union all
         select '03' col1 from dual union all
         select '04' col1 from dual 
        )
          
        
    My question
    How to join table1.col1 table2.col1? since they are different data types... .i tried to use To_char but then I got 0 zero,.
    is there is all the functions I can use?


    Thank you!!

    user642297 wrote:
    Hello experts,

    I have two tables...

    create table1
    (
    col1 varchar2(20)
    );
    
    create table2
    (
    col1 number(10)
    );  
    

    with their data as below

    Above, you said that table2.col1 was a NUMBER.
    Below, is a VARCHAR2:

    with table1 as
    (  select 'xx' col1 from dual union all
    select 'yy' col1  from dual union all
    select '01' col1  from dual union all
    select '02' col1  from dual union all
    select '03' col1  from dual union all
    select '04' col1  from dual
    ),table2 as
    (
    select '01' col1 from dual union all
    select '02' col1 from dual union all
    select '03' col1 from dual union all
    select '04' col1 from dual
    )
    

    Woudn't be a better approximation of your real tables:

       ),table2 as
        (
          select 1 col1 from dual union all
          select 2 col1 from dual union all
          select 3 col1 from dual union all
          select 4 col1 from dual
         )
    

    ?

    My question
    How to join table1.col1 table2.col1? since they are different data types... .i tried to use To_char but then I got 0 zero,.
    is there is all the functions I can use?

    Your postal code. I think the best way is to use TO_CHAR, but maybe you were using it differently.

    SELECT     *
    FROM     table1
    JOIN     table2     ON     NVL ( LTRIM (table1.col1, '0')
                       , '0'
                       )     = TO_CHAR (table2.col1)
    ;
    

    This assumes that table1.col1 never contains decimal points, unary + signs, exhibitors, or other things like that.
    He will be responsible for negative numbers, but if table1.col1 contains 0 in front after the sign less (for example '-0012' "), then the solution is a bit more complicated.

  • iCloud full - found two backups with different dates

    My 20g iCloud storage is full.  When I went to manage my data, there were 2 backups of my iPhone with different dates.  Can I remove 1 of them (the older one I guess) without affecting my current phone?  I guess that's when I upgraded my iPhone 4 to 5

    Of,.

    Yes, as long as you can identify with certainty the backup latest.

  • Creating a line chart PDF-report generator model with APEX

    Hi all

    I would like to create a PDF report with a chart using Apex and the generator plugin model for Word.

    My Select statement, which I use as the report (shared components) query returns the data in the following way:

    Date Description amount

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

    01.01.2014 has 1.2

    02.01.2014 has 1.3

    03.01.2014 has 0.5

    01.01.2014 B 0.3

    02.01.2014 B 4.5

    03.01.2014 B 4.8

    The XML document obtained, which creates the APEX, is:

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

    < DOCUMENT >

    < DATE > 08/10/2014 < / DATE >

    ADMIN < user_name > < / username >

    < > 102 APP_ID < / APP_ID >

    < APP_NAME > Oracle APEX AppBuilder < / APP_NAME >

    < /Title > < TITLE > graph

    < REGION ID = "0" >

    rowset <>

    < ROW >

    < date > < / Date >

    < DESCRIPTION > < / DESCRIPTION >

    < value > < / value >

    < / ROW >

    < / LINES >

    < / REGION >

    < / DOCUMENT >

    What I would like to have is a line graph with:

    • Date on the x-axis
    • Length of value on axis y
    • for each Description of Type single line

    The names and numbers of the discription varies a lot (as well as the values that they are related to the Description and date).

    What I tried:

    A lot, trying to make this work for 4 weeks, on and outside.

    Tried to edit the chart XML in Word, edit the SQL query, pivot the result SQL to get the Descriptions as columns and of course a lot of Googling.

    Please let me know if you have any advice.

    Thanks in advance,

    Thomas

    Oracle DB: 11g

    ApEx Version: 4.2.5.00.08

    Last Oracle BI Builder Plugin for Word template

    Finally found my Solution. What I was looking for is:

  • Create a dynamic text in Flex with different attributes

    I create a Flex text field that looks like this:

    < mx:HBox id = "lastInfo" styleName = "Bar" width = "100%" visible = "false" >
    < text mx:Text = "' your last question was:" styleName = "underline" / > "
    < mx:Text id = "lastQuestion" styleName = "bold" / >
    < mx:Text text = "in the context:" / >
    < mx:Text id = "lastContext" styleName = "bold" / >
    < text mx:Text = "' the last line:" styleName = "underline" / > "
    < mx:Text id = "lastAnswers" styleName = "bold" / >
    < / mx:HBox >

    The text that is not dynamic needs to be emphasized. The text that arise in a dynamic way must be bold.

    lastQuestion, lastContext and lastAnswers are dynamically filled. The problem is that if lastAnswers width exceeds the threshold of the HBox it isn't newline at the beginning of the complete chain.

    How can I create this complete string dynamically and with highlights and fat all-in-one text, so it will be transport back to the beginning?

    Hi Cootis,

    Now, I understand your question, but the approach that you use is not correct I think because for the formatting you want you must use a single control and assign the htmlText dynamically.

    See the code example below:


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete ="init (); » >


       
    private var lastQuestion:String = ""what is your name.'; "
    private var lastContext:String = "your name";
    private var lastAnswers:String = 'John John John JohnJohn-JohnJohn-JohnJohn-JohnJohn-JohnJohn-JohnJohn John';
          
    public void init (): void
    {
    variableText.htmlText = "your last question was:" + lastQuestion + "context:" + lastContext + "the last replica:" + lastAnswers;
    }
    ]]>


        

    So you have to pouplate variables dynamically, that's all.

    I hope it works for you.

    If this post answers your question or assistance, please mark it as such.

    Thank you

    Jean Claude Chari

  • Newbie: why can I not use a collection of table to feed a line chart series

    Unfortunately, I have a simple wish, but I'm spending hours trying to get this to work flex.

    1. take a collection of table

    2. Enter the data in a chart.

    To bind the data to the table... I tried all kinds of combinations of "@date" or data.date or {date}... etc...

    Below, works now... why?  (Note, when I self an XMLListcollection and @close for data binding, it seems to work)

    I'm at the beginning of the career of 'flex' and must admit that it is difficult with the lack of detailed examples, so hopeful of inspiration.

    < mx:ArrayCollection id = "2" >
    < mx:source >
    < mx:Object date = open '8' = '40,38' close = "40.81" / >
    < mx:Object date = '9' open = "40.5" close = "40,41" / >
    < mx:Object date = "10" open = '40,82' close = "40.6" / >
    < / mx:source >
    < / mx:ArrayCollection >

    < mx:Panel title = 'LineChart and AreaChart control 3.
    = "84" height = "491" width = "729" layout = "horizontal" x = "350" >
    < mx:LineChart id = 'linechart' height = '100% ' width = '100% '.
    paddingLeft = "5" = "5" paddingRight
    showDataTips = "true" dataProvider = "{2}" >
    < mx:horizontalAxis >
    < mx:CategoryAxis id = categoryField = "{data.date 'ca'}" title = "Date" / > "
    < / mx:horizontalAxis >
    < mx:series >
    < mx:LineSeries yField = "{data.close}" form = "curve" displayName = "Profit" lineStroke = "{s1}" / > ""
    < / mx:series >
    < / mx:LineChart >
    < mx:Legend dataProvider = "{linechart}" / >
    < / mx:Panel >

    Try categoryField = "date" and yField = "close" with no braces.

  • HTTP issues with different service providers

    My apologies if this has been posted and answered before. I'm new to the Blackberry development.

    I'm developing an application initially for the 8300 Series. Timing of the launch, my application tries to open an http connection to check the updates of the application.

    I have no problem, the application running on the Simulator, and if I add '; deviceside = true"to the url, the app works on an ATT device. However, when I run the application on a device, Verizon or T-Mobile, I get a network error, whether or not '; deviceside = true' is included.

    I tried messing around with the TCP APN settings on the device from T-mobile with no luck. The Verizon device does not appear to have that option at all. Browsers seem to work so there is a valid data connection.

    Anyone know what the problem is or what I could do wrong?

    Thanks in advance.

    The problem was with the data plan, a feature or another was not enabled.

  • Why have I not two record creative Cloud suddenly with different data in each folder (a folder called Creative Cloud Files (unknown))

    This morning, I've connected and started working as usual. When I went to save on I noticed a new folder in the Bridge, called "Creative Cloud Files (unknown) without data in it. Weird, but what ever. So I recorded my file and dinked around a structure of files and cleaned a little. I have noticed that my sharing icon disappeared from records and questioned on this subject, but kept the job because I'm on a deadline.

    So now it is wobbly data to the new file folder that does not match the original file of CC. I don't know where are my latest files and some files are all simple missing. I'm increased and confused about what is happening. Can someone shed some light on this?

    With the recent update of the application of Creative Cloud Desktop (1.9.1.474), we have unfortunately introduced a bug that causes the creation of a new Creative Cloud Files folder and re-synchronization of all content. This will happen only the first time that the synchronization application runs after the update. This caused an understandable pain and confusion, for which we really apologize.

    Creative application Cloud Files contains a logic that supports the use of several Adobe ID. This allows to disconnect from an ID and in, but keeps the contents of your separate creative cloud. When you sign out and change identifiers, the app moves the previous creative Cloud Files folder and it's content and he adds with the already signed in ID (User@AdobeID). Then, it creates a main folder and begins to synchronize the content of the identification of new.

    The bug I mentioned earlier occurs, as the app believes an ID selector took place and as such, moves the current record of Creative Cloud Files and attempts to annex the already signed in ID. As no switch actually took place, it manifests as (unknown).  The application then creates a main folder to synchronize the data.

    What you end up with is essentially a creative Cloud Files folder with your new synchronized data and a creative Cloud Files (unknown) folder that contains duplicate data.

    This happens once, after the last update.

    The solution is to simply delete the (unknown) Creative Cloud Files folder.

    I recommend that ensure you that you have no pending change you can do offline and you check the contents of the folder new, main designer Cloud Files contains everything you expect of him.  If this is not the case, check the contents of the creative Cloud files (unknown).

    If there is still an incompatibility with your data, you can check on creative.adobe.com to confirm that your data is there.

    If you have any other problems or questions on this topic please email [email protected]

  • regexp: how to deal with different date formats?

    the date comes as varchar2 with '-'and':' as separators for day part and part time respectively. but it may come with different formats such as

    1993-05-17
    1993-05-17 13:04:23
    1993-05-17 13:04
    1993-05-17 13:4
    1993-05-17 13:04
    1993-05-17 13:4:2
    1993-5-17-13:4:2
    1993-5-7-13:4:2

    and so on. date of final format should be ' YYYY-MM-DD HH24-SS'. is it possible to have an intelligent way to deal with different formats of date with separators above and convert the final using regexp format, so that it is compact and universal as possible with assumptions/examples above?

    Thank you

    As others have said, the smartest way is to keep your input in a format method and store your data in a date column.
    But is a simple way to deal with this mess, without regexp,

    with test as (
    select '1993-05-17' d from dual
    union all select '1993-05-17 13:04:23' from dual
    union all select '1993-05-17 13:04' from dual
    union all select '1993-05-17 13:4' from dual
    union all select '1993-05-17 13:4:2' from dual
    union all select '1993-5-17 13:4:2' from dual
    union all select '1993-5-7 13:4:2' from dual
    union all select '1993-05-17 1:4 PM' from dual
    )
    select d
         , to_date( translate( d, 'xampAMP', 'x' )
                  , 'yyyy-mm-dd hh24:mi:ss'
                  )
         + case when instr( upper( d ), 'P' ) > 0 then 0.5 else 0 end cd
    from test
    
  • Acrobat Pro XI: Creating a form of page multi with repeated fields requiring different input values

    Hello.  I am working on a form that has more than 130 areas by page and 16 pages.  The form is a set of report cards for a classroom.  All except two fields per page will have to repeat on each page, but NOT duplicate the input value.  These are individual students names and brands in different areas of the assessment for the 4 quarterly marking periods and the teacher comments (each page of the form is a report card x 16 students the students in the class).  I need to work on platforms (PC and Mac), or I'd do it in Word.  Word and Pages don't play well with the complex layout of the form, so I turned to Acrobat.

    I am looking for a way to set up a page and then copy the fields on the following pages, with a suffix or another convention that can quickly be changed per page without frames of hand-label nearly 2400 / form (on top of that, I am doing this for 7 classes).  I read that using the naming convention item.0 allows duplicate fields to select and the +/-key to adjust the suffix without going into the Properties dialog or the area of field to rename, but it does not work for me and I find enough information about the feature to help me with what I'm doing wrong.

    If there is a better way to do it, I'm open to all suggestions.  I need help if the script is needed, as I am not a programmer.

    Thank you in advance for your help!

    Usig the increment/decrement keys +/-, the tail number is no longer a feature available. I believe he was abducted with Acrobat 6, but it may have been 7.

    You can use a hidden template page to make their fields on a page and to ensure that the fields are automatically renamed. First create you a blank page, copy a page of the fields on the blank page and make a hidden model. You can then use the template.spawn JavaScript method to add fields to any other page. For more information, see: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1216.html

    I know that this answer is sparse, so if you have any other questions, post again and understand which version of Acrobat you are using.

  • Dynamically hide a line chart series

    I have a chart with multiple lines (line series) available to the user. I would like to allow the user to have the ability to enable and disable each line individually. I've tried several things without success... I even went as far as the activating/deactivating the alpha of the lineseries to between 1 and 0 :-), but I KNOW there is an easier way. Any help would be appreciated.

    Kevin

    Sorry... beginners discovered the 'visible' property... :-)

  • Error creating the pie chart to 3D with query complex.

    Hi all

    I tried to create a pie 3D with the following query:

    SELECT THE NULL LINK,

    LABEL CRITERIA,

    DIGITAL VALUE

    Of

    (SELECT CRITERIA, COUNT (*) AS 'NUMBER'

    DE)

    SELECT AIRCRAFT_REGO AS "REGO",.

    'HOLD OPEN' as "CRITERIA", he said.

    CNTOPEN AS 'COUNT '.

    OF UTEV0001 HAS

    INNER JOIN (select ACFTABB, count (ACFTABB) as CNTOPEN)

    of SIMLOG

    "where ACDFRCYC = s"

    AND OPENHODM = 'O'

    AND ACDFITMX = 'Y '.

    ACFTABB GROUP

    order of ACFTABB) B

    ON B.ACFTABB = A.AIRCRAFT_REGO

    WHERE AUDTCURI = 'C '.

    UNION

    SELECT AIRCRAFT_REGO AS "REGO",.

    "NOT PROCESSED" as of "CRITERIA", he said.

    CNTACTN AS 'COUNT '.

    OF UTEV0001 X

    JOIN IN-HOUSE

    (select ACFTABB, count (ACFTABB) as CNTACTN

    of SIMLOG

    "where ACDFRCYC = s"

    AND ACDFATN = "

    AND AFFECTED = "

    ACFTABB GROUP

    order of ACFTABB) C

    ON X.AIRCRAFT_REGO = C.ACFTABB

    WHERE AUDTCURI = 'C '.

    UNION

    SELECT AIRCRAFT_REGO AS "REGO",.

    "FAILURE to KNOWN" as "CRITERIA", he said.

    CNTKNOW AS 'COUNT '.

    OF UTEV0001 Y

    INNER JOIN (SELECT ACFTABB, COUNT (ACFTABB) AS CNTKNOW

    OF SIMLOG

    WHERE ACDFRCYC = S"

    AND AFFECTED = 'DEVELOPMENT '.

    ACFTABB GROUP

    order of ACFTABB) D

    ON Y.AIRCRAFT_REGO = D.ACFTABB

    WHERE AUDTCURI = 'C '.

    UNION

    SELECT AIRCRAFT_REGO AS "REGO",.

    'WARRANTY FAILURES' as "CRITERIA", he said.

    CNTWARNT AS 'COUNT '.

    OF UTEV0001 Z

    INNER JOIN (SELECT ACFTABB, COUNT (ACFTABB) AS CNTWARNT

    OF SIMLOG

    WHERE ACDFRCYC = S"

    AND GUARANTEED = 'Y '.

    ACFTABB GROUP

    order of ACFTABB) E

    ON Z.AIRCRAFT_REGO = E.ACFTABB

    WHERE AUDTCURI = 'C '.

    UNION

    SELECT AIRCRAFT_REGO AS "REGO",.

    "REFER CONTROLLER" as of "CRITERIA", he said.

    CNTCONT AS 'COUNT '.

    OF UTEV0001 V

    INNER JOIN (SELECT ACFTABB, COUNT (ACFTABB) AS CNTCONT

    OF SIMLOG

    WHERE ACDFRCYC = S"

    AND AFFECTED LIKE '% CONTROLLER '.

    ACFTABB GROUP

    order of ACFTABB) F

    ON V.AIRCRAFT_REGO = F.ACFTABB

    WHERE AUDTCURI = 'C')

    CRITERIA GROUP)

    Using this query, I get the following error "failed to parse the SQL query! "

    But when I use the query used to create the table here. It works perfectly fine.

    Could someone help me please.

    Hi Ajay,

    I would say it is your use of the key word 'number '. I would like to change it to "MY_COUNT" or something.

    I certainly expect

    SELECT THE NULL LINK,

    LABEL CRITERIA,

    DIGITAL VALUE

    fail because of the number keyword.

    Kofi

  • How to create a second Adobe PDF printer with different parameters?

    Hi all

    I know that it is possible to create copies more or less unlimited normal printers under Windows (XP SP2) which each have their own settings. Very useful for standard jobs that require special configurations.

    We want to use the same technique for the creation of PDF. Now, I'm wondering how to create a second Adobe PDF printer?

    I try to create a new printer on the printer port "my Documents\ * .pdf" which is used by the existing printer, but I wonder what driver to use. Unfortunately there is no Adobe entry in the list and I can not find manually, either.

    We are still on Acrobat 8 (Professional)

    Any tips?

    Thank you very much

    Mike

    The easiest way is to add a generic printer driver. Then enter the properties, change the name and set up the port and in the printer driver. Then edit the remaining properties. You may need to leave after selecting Properties and then open back for these properties took effect. If you are looking for using the PDF Maker printer you should change the name to Adobe PDF, and you can have one of these. For use as a printer, then the other name will work fine.

    It's been a while since I've done this type of addition, but it worked when I did it.

  • Several lines in a row with different column name

    Hello
    I have the table "v_Profile_ID" and "v_Trasaction".

    V_profile_ID columns
    1 profile_nbr
    2 idendifaction_number

    V_Trasaction columns (a historical data)
    1 profile_nbr
    2 Transaction_ID
    3.TransactionDate_Time
    4.Transaction_amount


    common profile_nbr in the tables 'v_Profile_ID' and 'v_Trasaction '.

    Are values in the v_profile_ID table

    profile_nbr Identification_nbr

    1001 Au1002
    1001 BD9089
    1001 FC3900


    To view the identification_3 of v_profile_ID, identification_2, identification_1, Profile_nbr
    and TransactionDate_Time Transaction_amount of v_Trasaction

    Profile_nbr identification_1 identification_2 identification_3 TransactionDate_Time Transaction_amount

    1001 Au1002 BD9089 FC3900 1000 2 April 2011


    Please can someone help me

    Thank you
    Petrilla

    Hello

    Try this... !!

    Select profile_nbr,
    max(decode(seq,1,identification_nbr,null)) identification_1,
    max(decode(seq,2,identification_nbr,null)) identification_2,
    max(decode(seq,3,identification_nbrl,null)) identification_3
    
    from (select profile_nbr,identification_nbr,row_number()
        over(partition by profile_nbr
           order by identification_nbr) seq
            from table_name) where seq<=3;
             group by profile_nbr;
    

    Concerning
    KPR

    * If it's OK... then do as correct
    * If it's useful... then make it as useful

    Published by: KPR on April 29, 2011 04:53

  • Update records double with different data

    Hi all

    I have a specific problem of migration. Data from a large table were migrated in another table, but the data for the destination column are absent due to some problems (which are not specific to this topic).

    Currently I am updating the data for the missing column in the new table.

    The problem is due to the current data in the newtable, there the duplicate lines and I have not found a way to make a map of lines so that the data for the missing column can be updated.

    create the table ancienne_table

    (

    fileNo varchar (10),

    folder varchar (10),

    fileType varchar (10),

    col_1 varchar (10),

    col_2 varchar (10),

    col_3 varchar (10),

    col_4 varchar (10)

    );

    INSERT INTO ancienne_table (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('ABC', "Folder1", "Type1", '111', '111', ' 111', null);

    INSERT INTO ancienne_table (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('ABC', "Folder1", "Type2", '111', '111', ' 111', null);

    INSERT INTO ancienne_table (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('GHI', 'Folder3', 'Type3', '333', '333', ' 333 ', ' 333');

    INSERT INTO ancienne_table (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('JKL', 'Folder4', 'Type3', '444', '444', ' 444 ', ' 444');

    INSERT INTO ancienne_table (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('MNO', 'Folder5', 'Type4', '555', '555', ' 555 ', ' 555');

    INSERT INTO ancienne_table (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('PQR', 'Folder6', 'Type4', '666', '666', ' 666 ', ' 666');

    INSERT INTO ancienne_table (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('STU', 'Folder7', 'Type5', '777', '777', ' 777 ', ' 777')

    create table NewTable

    (

    fileNo varchar (10),

    folder varchar (10),

    fileType varchar (10),

    col_1 varchar (10),

    col_2 varchar (10),

    col_3 varchar (10),

    col_4 varchar (10)

    );

    INSERT INTO NewTable (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('ABC', "Folder1", null, ' 111 ', '111' ', 111', null);

    INSERT INTO NewTable (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('ABC', "Folder1", null, ' 111 ', '111' ', 111', null);

    INSERT INTO NewTable (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('GHI', 'Folder3', null, '333 ', '333', '333' 333');

    INSERT INTO NewTable (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('JKL', 'Folder4', null, '444 ', '444', '444' 444');

    INSERT INTO NewTable (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('MNO', 'Folder5', null, '555 ', '555', '555' 555');

    INSERT INTO NewTable (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('PQR', 'Folder6', null, '666 ', '666', '666' 666');

    INSERT INTO NewTable (fileNo, folder, file type, COL_1, COL_2, COL_3, COL_4) VALUES ('STU', 'Folder7', null, '777 ', '777', '777' 777')


    Select * from ancienne_table;

    FILENO FILETYPE COL_1, COL_2 COL_3 COL_4 FOLDER

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

    Type1 Folder1 ABC 111 111 111

    Type2 Folder1 ABC 111 111 111

    IGS Folder3 Type3 333 333 333 333

    JKL Folder4 Type3 444 444 444 444

    Folder5 Type4 555 555 555 555 MNO

    nPQR Type4 of Folder6 666 666 666 666

    STU Folder7 777 777 777 777 Type5

    Select * from NewTable.

    FILENO FILETYPE COL_1, COL_2 COL_3 COL_4 FOLDER

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

    Folder1 ABC 111 111 111

    Folder1 ABC 111 111 111

    IGS Folder3 333 333 333 333

    JKL Folder4 444 444 444 444

    Folder5 555 555 555 555 MNO

    PQR Folder6 666 666 666 666

    STU Folder7 777 777 777 777

    When you try to update the column of file type for all records-

    Update NewTable set FileType = (select FileType from ancienne_table where Fileno = newtable.fileNo and folder = NewTable. File);


    It would work fine for all other cases with the exception of the first two that are currently double.

    It won't work of course because it would give - "row subquery returns more rows" error because of these duplicate records.

    I'm trying to update the file type column to the first two rows with values 'Type1' and 'Type2 '.

    Out of these two files, it won't matter whose recording of newtable is updated with 'Type1' and you get 'Type2 '.

    Please help with ideas around update duplicate records with the ancienne_table-specific data into newtable.

    Him below will work... You can update using ROWID, but the lines are duplicated. Must therefore first to define any id for these two lines replicated using row_number and then correspond with rn for the IDENTIFIER specified.

    MERGE INTO NewTable nt help

    (WITH qry1 AS

    (SELECT ot. File type,

    ot.fileNo,

    OT. Folder,

    ROW_NUMBER() ON rn (PARTITION BY ot.fileNo, ot.folder ORDER BY 'A') - you can get the line number based on any order

    Of ancienne_table ot

    ),

    qry2 AS

    (SELECT nt. File type,

    nt.fileNo,

    NT. Folder,

    ROW_NUMBER() over (PARTITION BY nt.fileNo, nt.folder ORDER BY 'A') rn,-you can get the line number based on any order

    NT. ROWID rd

    OF NewTable nt

    )

    SELECT q1.filetype,

    Q2.Rd

    OF qry1 q1

    JOIN qry2 q2

    ON q1. Folder = q2. Folder

    AND q1.fileNo = q2.fileNo

    AND q1.rn = q2.rn

    AND q2. FileType IS NOTHING - if necessary add this condition

    ) q1 ON (nt. ROWID = q1.rd)

    WHEN MATCHED THEN

    Updated the VALUE of filetype = q1.filetype;

Maybe you are looking for

  • Randsomware

    Well guys. I was infected with randsomware, but what to do next. Do I trust these people with my credit card details in order to obtain the encryption key? I have all my files on a backup drive, but don't know how to remove the randsomeware. Remove i

  • Accommodation requirements and possibilities of the Web UI applications

    Hello I'm always evaluate LabVIEW Web UI and I have not yet built/deployed any application. But it is possible to deploy my Web applications user interface for cloud storage OR use as a host? In addition, it must be installed on the host of the LabVI

  • KB97417 update Framework 2.0

    Hallo, DAS wanted Update kann sich auf meinem PC nicht installieren und kommt wieder anyone therefore. Wie kann ich das abstellen. bzw. Warum sich der nicht Patch installed?

  • V - Portal of Vonage and Linksys RTP300 screw up the call diversion

    I have a situation where a Linksys RTP300 legacy and vestigial is unconnected to all phones, but only to the LAN seems to screw up the call between Vonage numbers forwarding phones attached to a single Vonage V-portal which can be found on the same L

  • VPN3k and communication inter-talks - need the official position Cisco

    Hi Experts. A Cisco VPN3k in a hub-and-spoke IPSEC network station will be able to route packets between the spokes? On the shelves, I have firewall Cisco Pix. Thank you Michele