How to populate corresponding values in another columns

product (table having below mentioned with data also)
product_name product_code product_id lob_id product_desc
DUMMY     DM     208182324072008     31     
Fleet     FL     196870715012008     31     Fleet
Commercial Vehicle CV     195147926122007     31     Commercial Vehicle
Private Car     PC     194398713122007     31     Private Car
Two Wheeler TW     194731914122007     31     Two Wheeler
cause_of claim ( table below mention fields with data)
cause_of_claim_id product_id cause_of_claim_code cause_of_claim_desc
198035026022008     194398713122007     TP     Third Party
198028726022008     194731914122007     TP     Third Party
198065826022008     196870715012008     TP     Third Party
198065726022008     196870715012008     OD     Own Damage
198045226022008     195147926122007     OD     Own Damage
198045326022008     195147926122007     TP     Third Party
i have mentioned cause_of_claim data based on below query cause_of_claim_code having different type of values. currently we are focusing on "OD" and "TP" only. thats why i have reduced unnessary columns.
select cause_of_claim_id,product_id,cause_of_claim_code,cause_of_claim_desc from cause_of_claim
where cause_of_claim_code='OD' or cause_of_claim_code='TP'
product and cause_of_claim we can join based on product_id.
in product table product_desc having
Two Wheeler
Private Car
Commercial Vehicle
Fleet
like that values...........
requirement is
where ever cause_of_claim_code ='OD' and
product_desc in (Two Wheeler,
Private Car,
Commercial Vehicle,
Fleet) need to populate one column dept_code and value should be value '31'
where ever cause_of_claim_code ='TP' and
product_desc in (Two Wheeler,
Private Car,
Fleet ) need to populate same column dept_code and value should be value '32'
where ever cause_of_claim_code ='TP' and
product_desc ='Commercial Vehicle'
need to populate same column dept_code and value should be value '39'
expected result
product_desc dept_code
Two Wheeler     31
Private Car     32
Two Wheeler     32
Commercial Vehicle 31
Fleet     32
Fleet     31
Private Car     32
Commercial Vehicle 39
Fleet     32
Private Car     31

This is school work. Please do the best you can then post it along with information about your version number (3 decimal places) and the issue you are experiencing with your code.
Please everyone ... I know you want to demonstrate your skill ... but students need to work these things out for themselves or they do not learn.

Similar Messages

  • Need to get sequence value in another column in oracle

    Hi ALL,
    I have sql query as below
    select header_id,order_number from oe_order_headers_all.
    and data it is displaying as
    heder_id     order_number
    111            500001
    121            500400
    I need to display  another field with some sequence value like as below
    id     heder_id     order_number
    1      111                    500001
    2      121                    500400
    so how to get sequence value in another column please help me on this.
    Thnaks

    You can just use ROWNUM Pseudocolumn
    select rownum id, header_id,order_number from oe_order_headers_all

  • How to copy one column BLOB value into another column of another database.

    How to copy one column BLOB value into another column of another database.
    BLOB value contains word document.
    I thought of copy the BLOB value into a text file and then update the new column value by the same text in textfile. Will this work?
    Is there any other better way to do this?

    You're welcome
    BLOB fields contains binary data. I don't think you can do this
    Also if I view the BLOB as text. Can I copy it and insert into the new database.
    I think your options are as I said. Datapump or CTAS
    Best Regards

  • Summing Selected Rows in Column Depending on Value in Another Column

    I'd like to sum only the values in selected rows in a given column depending on the value of another column in the same row. For example, suppose I have a table (please disregard the underscores, needed for correct alignment):
    ___A____B____C___D
    1__5___10___15___0
    2_20___25___30___1
    3_35___40___45___1
    4_50___55___60___0
    5__sum(D=1)
    In cell B5, I'd like to compute the sum of only rows in column B for which the value of the corresponding column D is 1. In this case B5 would be 65.
    How can I do this using functions? Is it possible to do it for a variable range of rows without specifying each row individually?
    Thanks,
    Dave

    You should place your formula to other collumn then calculated ones or in another table. You will be able to calculate whole collumns with: =SUMIF(D;“=1”;B)
    Formula for your example is: =SUMIF(D1:D4;“=1”;B1:B4)
    VB

  • Color a column based on value in another column in tableview

    I am using a tableview iterator to display data in a bsp page. I want to color a cell in particular column (column 4), when a value in another column (column 2) on that same row is greater than 20. I can color the cell in column 2 but am not able to color the cell in column 4. How can I accomplish this?
    This is what I have. Looks like val1 is losing it's value.
    CASE p_column_index.
        WHEN 2.
          ASSIGN p_row_data_ref->* TO <row>.
          ASSIGN COMPONENT 'ZTGT' OF STRUCTURE <row> TO <col>.
          VAL = <col>.
          IF VAL GT '20'.
            val1 = p_row_index.
            p_style = 'celldesign:CRITICALVALUE_DARK'.
          ENDIF.
        WHEN 4.
            if p_row_index = val1.
              p_style = 'celldesign:CRITICALVALUE_DARK'.
            endif.
        WHEN OTHERS.
    do nothing
      ENDCASE.

    The reason val1 is "loosing its' value" is presumably because you have defined it in the method as a local variable. So each time you call the RENDER_CELL_START method it is is newly initialised. So if you make this an instance attribute it will retain its' contents across method calls.
    Cheers
    Graham Robbo

  • How to populate default values for BP (FPP1 is  tcode in ECC 6.0)

    Hello ,
    I am creating BP in ECC 6.0 using Fpp1 tcode.  How to populate default values when i hit create BP person.   any badi  triggers when we are creating BP in ECC.
    guide me.

    Hi Premanand,
    To default fields, you need to do the following steps :
    1. Create a Z module e.g. : Z_DEFAULT_FIELDS_DIALOG.
    2. Enter suppose you want to default fiels Name, title, country, write code as follows  :
    DATA : ls_busdefault LIKE busdefault.     
      ls_busdefault-title = '0002'.
      ls_busdefault-mc_name1 = 'TEST'.
      ls_busdefault-mc_name2 = 'Default'.
      ls_busdefault-country = 'IN'.
        CALL FUNCTION 'BUP_BUPA_FIELDVALUES_SET'
        EXPORTING
          i_busdefault = ls_busdefalut.
    3. Now got to transaction BUS7, select event ISDAT, click on Event--> function modules.
    4. Register your Z module Z_DEFAULT_FIELDS_DIALOG in this list, Save.
    This should solve your problem. Please note : You can only default those fields contained in structure BUSDEFAULT.
    Cheers,
    Rishu.

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • How to display the value of a column in a chart at the top of each column

    How to display the value of each column in a chart at the top of each column?

    Like this?
    Done using chart Inspector.
    For details, see Chapter 7,  Creating Charts from Numerical Data in the Numbers '09 User Guide. The guide may be downloaded via the Help menu in Numbers.
    Regards,
    Barry

  • How to populate f4 values to standard pnp selection screen fields

    Hi Experts,
    my question is how to populate f4 values to standard pnp selection screen field. i am using LDB PNP for a report , it displays several fields with f4 values, i need to remove all the stadard f4 values and want to place my  f4 values in the selection screen

    Hi Venkat,
    To put ur own values in the F4 help of any field...all u have to do is.
    1st fetch all the records that u need to display in F4 help list...in one internal table.
    and then use the function module  'F4IF_INT_TABLE_VALUE_REQUEST'
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
    retfield =
    value_org =
    tables
    value_tab =
    return_tab =
    exceptions
    parameter_error = 1
    no_values_found = 2
    others = 3.
    where retfield is the field for which u need to give the F4 help.
    and valu_tab is the internal table in which u have the list of records to be displayed.
    this would do the work...
    I dont have the system in front of me...as soon as i have...will try to send a piece of code, to make ur work easy.
    Till then hope this helps u...all the best
    Regards,
    Radhika

  • How to use Special value set with Column clause to display addtional column

    hi
    can anyone tell me
    How to use Special value set with Column clause to display addtional column
    how can i use FND POPID and with COLUMN clause ?

    Dear Yaseen,
                To get the value in formula cumulative,after you have created the formula for that particular key figure,go to edit and click on tab "calculations".
    In that select overall result as 'count all values not equal to zero' and single result as 'count all values not equal to zero' .
    And mark the cumulative check box underneath.
    I hope you get the desired result and please do me favour .
    Sumit goomber

  • HOW to send a value to another jsp page

    HOW to send a value to another jsp page, like user name in one jsp page to another jsp page

    In the most simplest form...
    // pageA.jsp
    <html>
    <body>
    <form action="pageB.jsp" method="post">
    <b>First Name:</b> <input type="text" name="FNAME" value="Joe">
    <input type="submit" value="Submit">
    </form>
    </body>
    </html>
    // pageB.jsp
    <html>
    <body>
    <b>Name:<b> <%=request.getParameter("FNAME")%>
    </body>
    </html>

  • Update one column while getting the value in another column

    Is it possible to in one single SQL statement update two columns in a table while at the same time obtaining the value of another column, on the same row, in the same table, and independently (that is, the update of the columns has nothing to do with the data that I want from another column)*?* Of course, I can do this in two operations, one being a "select" and the other one being an "update", but since I am in the same table and even on the same row, is it really necessary to make TWO database calls? That's why I want to combine the the two SQL-statements, for reasons of presumed effiency.

    jsun wrote:
    Is it possible to in one single SQL statement update two columns in a table while at the same time obtaining the value of another column, on the same row, in the same table, and independently (that is, the update of the columns has nothing to do with the data that I want from another column)*?* Of course, I can do this in two operations, one being a "select" and the other one being an "update", but since I am in the same table and even on the same row, is it really necessary to make TWO database calls? That's why I want to combine the the two SQL-statements, for reasons of presumed effiency.Two statements != two database calls.
    At least not in terms of SQL.
    JDBC requires a 'statement' but in SQL (depending on the data source) that can include multiple statements. An obvious example of this is a stored proc but there are other ways as well.

  • How to insert varchar2 value in timestamp column in table?

    Hi all,
    Hope doing well,
    sir i am using one stored procedure and storing time in varchar2 variable in this format: 08:00:00
    now i have to insert this value in timestamp column in table. how to insert this value in timestamp column?
    thanks

    952646 wrote:
    Hi all,
    Hope doing well,
    sir i am using one stored procedure and storing time in varchar2 variable A "Very Bad Idea"(tm)
    When you do this, there is no fundamental difference between "08:00:00" and "here's your sign".
    Data should always be stored in the correct data type. For dates and times, that data type is either DATE or TIMESTAMP. Period.
    in this format: 08:00:00
    now i have to insert this value in timestamp column in table. how to insert this value in timestamp column?
    Hopefully as remediation to the original bad design.
    thanks

  • How to merge values in a row, based on distinct values in another column

    I have a table like
    updatedby updateddate text
    John 01-May-2009 Approval record 1 added
    John 01-May-2009 Approval record 2 added
    David 02-May-2009 Approval record 1 removed
    I need the values of text column to be concatenated and displayed for unique records of (updatedby updateddate). The output is something like
    updatedby updateddate text
    John 01-May-2009 Approval record 1 added, Approval record 2 added
    David 02-May-2009 Approval record 1 removed
    I had planned to do it using PLSQL. Is there a way to get this done by SQl?.. Kindly suggest

    Prior to 10g:
    with t as (
               select 'John' updatedby,to_date('01-May-2009','dd-mon-yyyy') updateddate,'Approval record 1 added' text from dual union all
               select 'John',to_date('01-May-2009','dd-mon-yyyy'),'Approval record 2 added' from dual union all
               select 'David',to_date('02-May-2009','dd-mon-yyyy'),'Approval record 1 removed' from dual
    select  updatedby,
            updateddate,
            ltrim(sys_connect_by_path(text,','),',') text
      from  (
             select  t.*,
                     row_number() over(partition by updatedby,updateddate order by text) rn,
                     count(*) over(partition by updatedby,updateddate) cnt
               from  t
      where rn = cnt
      start with rn = 1
      connect by updatedby = prior updatedby
             and updateddate = prior updateddate
             and rn = prior rn + 1
      order by updateddate,
               updatedby
    UPDAT UPDATEDDA TEXT
    John  01-MAY-09 Approval record 1 added,Approval record 2 added
    David 02-MAY-09 Approval record 1 removed
    SQL> 10g and up:
    with t as (
               select 'John' updatedby,to_date('01-May-2009','dd-mon-yyyy') updateddate,'Approval record 1 added' text from dual union all
               select 'John',to_date('01-May-2009','dd-mon-yyyy'),'Approval record 2 added' from dual union all
               select 'David',to_date('02-May-2009','dd-mon-yyyy'),'Approval record 1 removed' from dual
    select  updatedby,
            updateddate,
            ltrim(sys_connect_by_path(text,','),',') text
      from  (
             select  t.*,
                     row_number() over(partition by updatedby,updateddate order by text) rn
               from  t
      where connect_by_isleaf = 1
      start with rn = 1
      connect by updatedby = prior updatedby
             and updateddate = prior updateddate
             and rn = prior rn + 1
      order by updatedby,
               updateddate
    with t as (
               select 'John' updatedby,to_date('01-May-2009','dd-mon-yyyy') updateddate,'Approval record 1 added' text from dual union all
               select 'John',to_date('01-May-2009','dd-mon-yyyy'),'Approval record 2 added' from dual union all
               select 'David',to_date('02-May-2009','dd-mon-yyyy'),'Approval record 1 removed' from dual
    select  updatedby,
            updateddate,
            ltrim(sys_connect_by_path(text,','),',') text
      from  (
             select  t.*,
                     row_number() over(partition by updatedby,updateddate order by text) rn
               from  t
      where connect_by_isleaf = 1
      start with rn = 1
      connect by updatedby = prior updatedby
             and updateddate = prior updateddate
             and rn = prior rn + 1
      order by updateddate,
               updatedby
    UPDAT UPDATEDDA TEXT
    John  01-MAY-09 Approval record 1 added,Approval record 2 added
    David 02-MAY-09 Approval record 1 removed
    SQL> SY.

  • "How to get distinct values of sharepoint column using SSRS"

    Hi,
        I have integrated sharepoint list data to SQL Server reporting services. I am using the below to query sharepoint list data using sql reporting services.
    <Query>
       <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
       <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
          <Parameters>
             <Parameter Name="listName">
                <DefaultValue>{GUID of list}</DefaultValue>
             </Parameter>
             <Parameter Name="viewName">
                <DefaultValue>{GUID of listview}</DefaultValue>
             </Parameter>
             <Parameter Name="rowLimit">
                <DefaultValue>9999</DefaultValue>
             </Parameter>           
          </Parameters>
       </Method>  
    <ElementPath IgnoreNamespaces="True">*</ElementPath>
    </Query>
    By using this query, I am getting a dataset which includes all the columns of sharepoint list. Among these columns, I wanted to display only 2 columns (i.e Region and Sales type) using chart. I have created a Region parameter but when I click preview, the drop down box is giving me all the repeatative values of region like RG1,RG1,RG1,RG2,RG2,RG2,RG2,RG3.......... I wanted to display only distinct values of Region parameter so that whenever end user select region from the parameter drop down, it will display the respective value of Sales type column.
    Also when I select only RG1 parameter, it is giving me a chart including the sales type of all the Regions. (it should display me only the sales type of RG1) How can I link these 2 columns so that they will display the values respectively.
              I would really appreciate if anyone can help me out with this.
    Thanks,
    Sam.

    Hi Sam,
    By code, the CAML language doesn’t have any reserved word (or tag) to set this particular filter to remove duplicate results.
    In this case, we could use the custom code to get distinct records.
    Here are the detailed steps:
    1.         Create a hidden parameter that gets all the records in one field.
    Note: Please create another dataset that is same of the main dataset. This dataset is used for the parameter.
    2.         Create a function that used to remove the duplicate records.
    Here is the code:
    Public Shared Function RemoveDups(ByVal items As String) As String
    Dim noDups As New System.Collections.ArrayList()
    Dim SpStr
    SpStr = Split(items ,",")
    For i As Integer=0 To Ubound(Spstr)
    If Not noDups.Contains(SpStr(i).Trim()) Then
    noDups.Add(SpStr(i).Trim())
    End If
    Next
    Dim uniqueItems As String() = New String(noDups.Count-1){}
    noDups.CopyTo(uniqueItems)
    Return String.Join(",", uniqueItems)
    End Function
    3.         Create another parameter that will be used for filtering the maindata.
    Please set the available value to be =Split(Code.RemoveDups(JOIN(Parameters!ISSUE_STATUS_TEMP.Value, ",")), ",")
    And the default value to be the value you what such as the first value:
    =Split(Code.RemoveDups(JOIN(Parameters!ISSUE_STATUS_TEMP.Value, ",")), ",").(0)
    4.         Go to the main dataset. Open the property window of this dataset.
    5.         In the “Filters” tab, set the filter to be:
    Expression: <The field to be filter>
    Operator: =
    Value: =Parameters!Region.Value
    The parameter “Region” should be the parameter we created in the step3.
    Now, we should get distinct values of SharePoint columns.
    If there is anything unclear, please feel free to ask.
    Thanks,
    Jin
    Jin Chen - MSFT

Maybe you are looking for

  • Error code 0xc000025, cannot install or recover windows

    Hello, I have ENVY 15-j002ex laptop and unfortunately I didn't recover the windows on an external device or disk. I was trying to partition the hard disk but it failed and after I restarted, I got the following error. Your pc needs to be repaired A r

  • Flash player is not working

    it says it is installed.  I do the test on the adobe flash test page and it says either flash player is disabled or active x is on.  I did all the troubleshooting but it doest give me the option to enable the flashplayer on the manage add-ons screen.

  • Calculating Position of Rectangle Corners

    Hello again everyone - I'm in the middle of attempting to write my own collision detection algorithm because the built in 'hitTestObject' function seems to be incredibly inaccurate (it's registering 'hits' when the objects are still a considerable di

  • ABAP Report duplicating IDOC

    Hello has anybody of you an ABAP Report, that is able to duplicate IDOCs? Regards Mario

  • Ask help about compile c++ file with occi!

    Hello, every one! I am new to use occi to write programmer under the solaries 5.8. I have a trouble to complie a c++ file.I use the below command to complie,and the machine print error root@sun1 # g++ -I/export/home/oracle/product/rdbms/demo -I/expor