How to split rows based on two columns..

Hi all...
I have a requirement.
I have product column, sell, purchace prices..(total of three columns) in a data set.
my data set is such a way that..if sale price exists...there is no purchase price and vice versa..
I need too present in a report ,two tables:
table 1 consists of only Sale price items
table 2 should contain only Pruchase Items.
Please see the below picture for clear understanding..
Is that doable? Where do we need to impose a condition?I tried to impose a condition but,it didnt seem to work
http://i51.tinypic.com/29xfdc6.jpg
Please help.

Can you send me the template and xml file to [email protected]? I can try to help.
Did you try to filter out the records by the sale price or purchase price column not equal to null?
Thanks,
Bipuser

Similar Messages

  • Update multiple rows based on two columns in same row

    I have a 1000 rows in a table I would like to update with a unique value. This unique value is a cocatenation of two columns in teh same row.
    Each row has a (i) date and a (ii) time and a (iii) date_time column. I would like to update the date_time (iii) column with a cocatenation of the (i) date and (ii) time columns.
    I know how I would update a single row but how can I update multiple rows with a cocatenation of each of the two columns - i.e put a different value into the date_time column for each row?

    this?
    update table tab_name
    set date_time =date||time
    where your_condition

  • Unique row based on two columns and single column

    Dear Members,
    I have a table which contains duplicate rows, for which a query should be able to fetch the unique row from the table. Here the unique is not based on one column, but it should be on two columns and also check for uniqueness on one column.
    create table addr ( firstname varchar2(10), lastname varchar2(10), area varchar2(3));
    insert into addr values('bob', 'james', '1');
    insert into addr values('bob', 'james', '1');
    insert into addr values('harry', 'bert', '1');
    insert into addr values('jimmy', 'bert', '1');
    insert into addr values('sam', 'mac', '1');
    insert into addr values('sam', 'knight', '1');
    insert into addr values('tom', 'sand', '1');
    insert into addr values('cat', 'mud', '1');
    The output of query should contain 3 rows.
    bob - james
    harry - bert or jimmy - bert [ either one of them, but not both ]
    sam - mac or sam - knight [ either one of them, but not both ]
    tom - sand
    cat - mud
    SELECT firstname, lastname as total from addr WHERE area = '1' GROUP by firstname,lastname; This does not take of single column duplication..
    Any suggestions..

    SQL> with t_data
    as
    select 'bob' as firstname, 'james' as lastname, '1' as area from dual union all
    select 'bob', 'james', '1' from dual union all
    select 'harry', 'bert', '1' from dual union all
    select 'jimmy', 'bert', '1' from dual union all
    select 'sam', 'mac', '1' from dual union all
    select 'sam', 'knight', '1' from dual union all
    select 'tom', 'sand', '1' from dual union all
    select 'cat', 'mud', '1' from dual
    SELECT
            firstname,
            lastname,
            area
    FROM
                    SELECT
                            t.*,
                            row_number() over(partition BY firstname order by 1) rn,
                            row_number() over(partition BY lastname order by 1) rn1
                    FROM
                            t_data t
    WHERE
            rn     = 1
    AND rn1 =1 ; 
    FIRSTNAME       LASTNAME        AREA
    bob             james           1
    cat             mud             1
    jimmy           bert            1
    sam             knight          1
    tom             sand            1
    SQL>

  • How to split 'Full Name' into two columns for 'First' and 'Last' name??

    Any ideas on how to achieve this? http://office.microsoft.com/en-us/excel-help/split-names-by-using-convert-text-t o-columns-HA001149851.aspx

    If:
    A1 = Fistname Lastname
    For firstname:
    (First Name) B1 =SUBSTITUTE($A1," " & $C1, "")
    For the Last name:
    (Last Name) C1 =RIGHT(A1,LEN(A1)-FIND("#",SUBSTITUTE(A1," ","#",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
    If
    A1 = Lastname, Firstname
    (Last Name) B1 =SUBSTITUTE($A1,", " & $C1, "")
    (First Name) C1 =RIGHT($A1,LEN($A1)-FIND("#",SUBSTITUTE($A1," ","#",LEN($A1)-LEN(SUBSTITUTE($A1," ","")))))
    Let me know if you need one that traps multiple commas or middle names.

  • How to display data based on two columns in Apex calendar?

    I have a table for holiday details with 2 date columns...from-date and a to-date. I need to display the name of the person for the date range they have specified. For Ex if i applied for leaves from may 1 to may 4...the calendar should display my name for 4 dates i.e may1,2,3 and 4
    I am new user in apex and still trying new things. Please help me achieve this.

    Swetha
    I created an application using Apex. It is a calendar application to show events that are happening. I ran into an issue with it
    If there is an event that occurs during an interval like August15 - August22, the event is shown only on August15, which is the first day of the event. I would like to show it in all days from August15-22.
    Here are the items coming from the page
    event_id number,
    employee_id number
    date_from date,
    date_to date,
    due_date date,
    act_id number,
    act_loc varchar2,
    reminder varchar2,
    frequency varchar2,
    division varchar2,
    event_status varchar2
    I am looking to write a process / procedure where it can show the same event on all the days it is occurring
    Thanks in advance
    Latha

  • Deleting duplicate rows based on three columns in Oracle 8i

    Hi all,
    The database we use is Oracle 8i.
    The query below raises the too_many_rows exception when I launch an application. So I want to delete the duplicated rows :
    select polarisation_1, polarisation_2
    into v_pol1_tech, v_pol2_tech
    from v_cfh_lien_element
    where nom_lien = p_nom_lien
    AND num_canal_1 = p_num_canal_1
    AND freq_emise_1 = p_freq_emise_1;
    Notice that with many possible values of the parameters p_nom_lien, p_num_canal_1 and p_freq_emise_1 then the exception is raised.
    So how to delete generally the duplicated rows based on the three columns "nom_lien" , "num_canal_1" and "freq_emise_1" ?
    Thank you very much indeed.

    Check the other thread with same question deleting duplicate rows based on three columns in Oracle 8i

  • Update column based on two columns

    Hi,
    MinValue     MaxValue    Desc
    -1                -1    
    -1                 1    
    -1                 2    
    0                  0    
    0                  1    
    0                  2 
    The above is my table which is having three columns MinValue, MaxValue, Desc. First two columns have data and I need to update the 3rd column 'Desc' based on two columns data.
    I need to update like,
    when MinValue=-1 and MaxValue=-1 then 'NotSpecified'
    when MinValue=-1 and MaxValue=1 then 'Up to 1'
    when MinValue=-1 and MaxValue=2 then 'Upto 2'
    when MinValue=0 and MaxValue=1 then 'At lest 1'
    when MinValue=0 and MaxValue=2 then 'At least 2'
    when MinValue=0 and MaxValue=3 then 'At least 3'
    The data in 'MaxValue' is like 1,2,3,4,5...50. So for each description it should append this value as mentioned above(till 'Up to 50', 'At least 50'). How can I do this with case statement?
    Thanks,
    Gangadhar

    declare @T table ( MinValue int,MaxValue int, [Desc] nvarchar(100) );
    insert @T ( MinValue, MaxValue )
    values ( -1, 1 ) , ( -1, 1 ) , ( -1, 2), ( 0, 0), ( 0, 1), ( 0, 2)
    select *
    from @T
    update @T
    set [Desc] = case
    when MinValue=-1 and MaxValue=-1 then 'NotSpecified'
    when MinValue=-1 and MaxValue=1 then 'Up to 1'
    when MinValue=-1 and MaxValue=2 then 'Upto 2'
    when MinValue=0 and MaxValue=1 then 'At lest 1'
    when MinValue=0 and MaxValue=2 then 'At least 2'
    when MinValue=0 and MaxValue=3 then 'At least 3'
    end
    select *
    from @T
    T-SQL Articles
    T-SQL e-book by TechNet Wiki Community
    T-SQL blog

  • Sorting based on two columns in report

    Hi,
    we have one issue on sorting based on two columns in report.
    In the report we are doing sorting on two columns(week_id and stage_name). I have attached the screen shot for the same. The sorting is first done on the week_id and then on the stage_name. The issue comes when we have no data for the stage 1 - Prospect in W1. The stage goes to the second position.
    Please suggest if there is any work around to show the 1 - Prospect stage in W1.
    Regards,
    Ambika Nanda.

    what is w1? where is screenshot? and is stage seoncd sort? if so what is the issue?

  • How to split invoice/document  into two venders?

    Can anyone please tell me how to split invoice/document into two vendors.  Like if I get an invoice for $1000 and it needs to be splitted between father and son, $500 to each.  How would I set that up in SAP?  I am not sure if this will be an invoice split or a document split.
    Thanks
    Monika

    If you are using an FI  entry F-43 to generate invoice this can be done by giving the same invoice ref. in the Inv. Ref. field  for two vendors. This is manual
    Document Split will split the document between two profit center and not between vendors.

  • Delete duplicate rows -- based on 4 columns -- how?

    I asked this question on how to delete duplicates recently and received this suggestion which works well -- except --
    With CTE AS
    SELECT *, ROW_NUMBER() OVER (Partition by fld1 order by fld1) RowNum
    FROM #tmpA
    DELETE From CTE
    WHERE RowNum > 1
    -- the actual table I need to delete duplicate rows on is based on 4 columns.  The following table contains 14,462 rows of which 14,348 are distinct -- based on the following 4 colums.  Below is an image of a sample of the data contained in the
    table for my question and to the right of that data is the column structures (data types).  Is it possible to do something like the above example suggestion with the table in the image below?  How to do that?  I need to delete rows so that 14462
    goes down to 14348.  If I only reference one column for the delete -- this would delete like 7000+ rows.  I only need to remove 114 rows.
    Rich P

    Add the other 3 columns to the partition.
    Jason Long

  • Tabular report, how to split row into two lines per record

    Hi, I have a tabular report based on a collection. The collection has 15 fields and appears horizontally across the screen. I would like to have a break after the 5th column so that each row is on two lines instead of one. Is this possible...any information would be helpful.
    a shortened query is: and I would like the break to be between c028 and c029.
    thanks
    Karen
    Select apex_item.select_list_from_lov_xl
    (28,
    c028,
    'GEARS',
    'style="width:200px;background-color:#FBEC5D; "'
    || 'onchange="f_set_casc_gear(this,f29_'
    || LPAD (seq_id, 4, '0')
    || ')"',
    'YES',
    '0',
    '- Select Gear -',
    'f28_' || LPAD (seq_id, 4, '0'),
    NULL,
    'NO'
    ) gear_code,
    apex_item.select_list_from_query(29,
    c029,
    'select lma_desc e, lma_code r
    from lobster_mgmt_area
    where 1 in (select 1 from gears where gear_code = '
    ||nvl(c028,0)
    ||' AND (type_code in (''005'') and category_code in (''160'')) OR ('
    ||nvl(c028,0)
    ||' in (''130'')) ) order by lma_code ',
    'style="width:75px"',
    'YES',
    '0',
    '- Select -',
    'f29_' || LPAD (seq_id, 4, '0'),
    NULL,
    'NO') lma_code,
    apex_item.text
    (30,
    c030,
    6,
    NULL,
    'style="width:50px;background-color:#FBEC5D;"'
    ) gear_quantity
    from collections where collection_name = 'EFFORT_C'

    Hello Karen,
    >> and each field needs to be updateble ( concatenating two fields does not allow for that).
    Did you notice the ‘<br />’ component, as part of the columns concatenations?
    The following example is using the same principle – every two updatable column, from the employees table, are sharing the same tabular form row - http://htmldb.oracle.com/pls/otn/f?p=22710:420 . The report query is:
    select apex_item.text(10,first_name)||'<br />'||apex_item.text(11,last_name) col01,
    apex_item.text(12,phone_number)||'<br />'||apex_item.text(13,email) col02,
    apex_item.text(14,salary)||'<br />'||apex_item.text(15,commission) col03
    from employeesThe same principle is being used to define custom headings.
    Hope this time it will be more clear.
    Regards,
    Arie.

  • How can I split a header in two columns?

    Hello, for the past hour I've been trying to figure out how can I split/divide a header or footer in to two columns and then align text in the left collumn to left and the text in the right column to right.
    For example:
    | Header length                                                                                                   |
    | Left Align                                           |                                           Right Align |
    The only solution I have found was adding a table to the header, but it has some weird padding underneath it, which completely screws up its position in the footer.
    Anyway, I hope this makes sense and someone here knows how to do this.
    I really appriciate you reading this and am looking forward to your replies,
    James.

    You don't need a table.
    Menu > View > Show Ruler
    Leave the header left aligned and click on the ruler to create a Centred tab (if required) in the middle and a right hand tab to the right. You change the tabs by right clicking on them and choosing the orientation.
    Then enter your text:
    Left Text [tab] Centre Text (optional) [tab] Right Text
    With Facing pages you can set the Left and Right pages to be different to allow the Page numbers to the outside or inside of the spread.
    Peter

  • BC4J Objects with PKs based on two columns using multiple sequences

    I have implemented a BC4J object that is based on a DB table that has two columns as the primary key. For example Table A's primary key is Group and ID and there is a DB sequence for each Group.
    I use the BC4J object using servlets and JSPs and I have been able to implement an Update form.
    I now want to implement a Create (New) form. I've read forum postings and info on the help regarding using the SequenceImpl class to override the EntityImpl object's create method as shown below:
    protected void create(AttributeList attributeList)
    super.create(attributeList);
    SequenceImpl mySeq = new SequenceImpl("MY_SEQ",getDBTransaction());
    setMyObjectId(mySeq.getSequenceNumber());
    But as you can see I need to know the value of the group attribute before I can get the next value sequence:
    For new EO belonging in Group1 I need sequence from "GROUP1_SEQ", Group 2 from "GROUP2_SEQ", etc.
    I would like to put this code in the Entity Object where it belongs. I guess my problem is simply how to create a new row in the View Object with a passed parameter which is the value of Group.
    Thanks in advance!

    Angelo:
    How is the EO suppose to receive the group id? Is it from the view row? If so, the VO can pass that group id to the EO through the attribute list and calling the
    public Row createAndInitRow(AttributeList nvp);
    API.
    Example code would be:
    ViewObject myVO;
    // myVO is initialized
    AttributeList nvp = new oracle.jbo.NameValuePairs();
    // GroupID is the attr name of the Group ID
    nvp.setAttribute("GroupID", <some-value>);
    Row row = myVO.createAndInitRow(nvp);
    If you do that the create(AttributeList attributeList) method of the EO will receive the GroupID value coming from the VO.
    Then, you can use that for your sequence.
    Thanks.
    Sung

  • Merge Two Rows of a table to One row but into two columns

    Hi
    I Am struck in writing a query to merge two rows into two columns of one row.
    Here is the Sample data i am working with,
    Col 1     Col 2     Col3 Col4 Col Col6
    5000     573-3000 2     0     Phone      
    5000     573-3036 1     0          Fax
    5000     893-5703 3     0     WOrk      
    3000     232-5656     1     0     Phone     
    3000     353-5656     2     0          FAx
    Here Col,Col3,Col4 form the Key.
    now wht i am trying to do is to Merge these type of rows put them into Columns P,F,W,E respectively to achive a Structure as below
    Col1      P     F     W
    5000     573-3000      573-3036      893-5703
    3000     232-5656     353-5656     
    Can you please help me how could i do this.
    I am pretty ordinary at writing SQL's.
    Thanks a Lot in Advance
    Message was edited by:
    Sreebhushan

    Search the forum for PIVOT and you'll find plenty of examples.

  • Error when splitting a Table into two columns - Please help!

    Hi!
    I have created a table in which I have created a header which has been split into 3 parts conisting of 2 columns. These all work fine. However, when I try to split the row below the header row into 2 columns, it does so but, in a way, connects the line inbetween the two columns with the line inbetween the two columns above and will not allow me to move it left or right by manually changing specs or dragging the line. Please help! (I'm using CS5 by the way!) Thank you!

    I suggest you begin with a pre-built CSS Layout.  DW has several to help jump start your projects.  Go to File > New Blank Page > HTML.  Select a layout from the 3rd panel and hit CREATE.  See screenshot.
    Save this layout as test.html and begin building your prototype page saving and validating code often during your work sessions.
    Code Validation Tools
    CSS - http://jigsaw.w3.org/css-validator/
    HTML - http://validator.w3.org/
    Good luck with your project!
    Nancy O.

Maybe you are looking for

  • Can't sync data in login mode.

    i dont know what happend but when i sync my account in my other pc .i can't get the data which i have sync on my first pc.the thing is when i've click sync ,sync processing shows but not my bookmark,preference ,addons.nothing is sync please help all

  • I had to buy a new computer and had to open a new ITunes account is there anyway of merging the 2 accounts?

    I recently had to buy a new computer and had to download ITunes again, it wouldnt let me open ity with my normal account so had to open a new one, because of this i cant back up my phone cause it doesnt says as the data is from another ITunes i will

  • Buyer not able to change fields of SC in sourcing cockpit in SRM 7.0

    Hi We are on SRM 7.0 , SP 07 . We are in classic mode. Buyer is not able to change fields of shopping cart in sourcing cockpit like delivery date and quantity . He is able to add supplier and create PO . Even when he creates draft PO , he is not able

  • Using a Feedback Form FLA in Captivate

    To anyone looking for a challenge, I'm a longtime captivate user going back to the RoboDemo days. I've been excited to see its evolution over the last couple of years and recently began a project that required feedback from end users. I've coded a Fl

  • Why does my cs4 photoshop keep unexpectantly crashing?

    I'm having real problems with my Cs4 Photoshop (version 11.0.2). Everytime I attempt to open a file the program unexpectedly quits. This also happens often when I try to save files and also sometimes happens randomly while using photoshop, please hel