How to select data in the desired format?

I have a view as
ID | number | description | author
ad-8 | 34 | done | xyz
as-3 25 postpone abc
as-4 27 done xyz
ad-8 23 pending xyz
ad-7 43 done xyz
dr-1 24 done ..
df-6 29 done ..
as-3 31 pending ..
As is clear there are multiple values of ad-8 and as-3 etc...I want to remove these multiple entries and just have the entries with the largest numberi.e
ID | number | description | author
ad-8 | 34 | done | xyz
as-4 27 done xyz
ad-7 43 done xyz
dr-1 24 done ..
df-6 29 done ..
as-3 31 pending ..
note that I cannot use group by because than I would also have to include description in my group by statement and it would result in the same outcome...
Edited by: 804307 on Oct 22, 2010 12:11 AM
Edited by: 804307 on Oct 22, 2010 12:13 AM

done

Similar Messages

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

  • In the Date Picker, How can I default to select * dates if the user does ..

    In the Date Picker, How can I default to select * dates if the user does not select a date.
    Thanks,
    Doug

    Doug,
    Now lets say l want everythingCould you post some sample data and the output that you want to get..? It would be much easy to understand the requirements...
    When you mean everything, I am assuming you need all possible dates possible between date1 and date2.
    you can use... (from asktom.oracle.com).
      1  select to_date('12-jan-2009','DD-MON-YYYY') + rownum -1
      2    from ALL_OBJECTS
      3    where rownum <= (to_date('20-jan-2009','dd-mon-yyyy') -
      4*                     to_date('12-jan-2009','DD-MON-YYYY') +1 )
    sql> /
    TO_DATE('
    12-JAN-09
    13-JAN-09
    14-JAN-09
    15-JAN-09
    16-JAN-09
    17-JAN-09
    18-JAN-09
    19-JAN-09
    20-JAN-09
    9 rows selected.
    For your case, since you have date1 and date2...
    select to_date(:p12_date1,'DD-MON-YYYY') + rownum -1
      from ALL_OBJECTS
      where rownum <= (to_date(:p12_date2,'dd-mon-yyyy') -
                        to_date(:p12_date1,'DD-MON-YYYY') +1 )Should work.. in my opinion...Haven't tested the second one in Apex .
    Is this what you were looking for ..?? If not, please elaborate...
    Thanks,
    Rajesh.

  • How to select data from a table by passing document number from another tab

    How to select data from a table by passing document number from another table.
    for eg:-
    I want to display name, adres, region from ADRC table
    by using field delivery document number
    Kind Regards,
    Shanbagavalli.S

    Hi Shanbagavalli,
    There are multiple solutions to this questions a few i will try to answer and then you can take the best required for your requirements.
    **Consider that you have a Internal table having document number from other table..
    SELECT NAME ADRES REGION FROM ADRC
           INTO IT_ADRC
           FOR ALL ENTRIES IN IT_DOC
           WHERE DOCUMENT_NO = IT_DOC-DOCUMENT_NO.
    **Consider that you have 1 document number then
    SELECT NAME ADRES REGION FROM ADRC
         INTO IT_ADRC
         WHERE DOCUMENT_NO = W_DOCUMENT_NO.
    Hope this solves your problem.
    Regards,
    Kunjal

  • How to retreive data from the column of CLOb  dataype in BPEL.

    Hello Everyone,
    I have a scenario in which i have two databses primary and secondary. In first bpel process i am checking if primary database is down then store the payload in temp staging table in secondary database. That payload is getting stored in a cloumn of CLOB datatype in a text format.
    Now in second bpel process when primary is up i have to pull the data from the temp staging table...but here i want the data in the same format (like it came in the first process...the input payload format)....but as the CLOB will store the data as a text then how to reform that data in to ealier payload format.
    Can any one pls suggest me the solution...
    Thanks

    Confirm that you have the VISA Run Time Engine on the target machine. If you do not have it installed, you can install the VISA Run Time Engine from ni.com.
    Error -1073807346 Using VISA When Running LabVIEW Executable On Target Computer
    Message Edited by Mathan on 10-12-2009 07:11 AM

  • Reading selected data in the table control

    Hi Friends,
    I have final data in my table control now the user wants to select only few records from the displayed data, for that I kept a check box for selection, But my question is I am unable to read the selected data.
    Actually user requirement is he has to update only the selected data from the displayed data in the table control.
    Can any one tell me how to read the selected records after displaying in the table control.
    Thanx in advance,
    Line

    Hi
    If your table control has a check box, your internal table should have a field for it. Its value will be X if the checkbox is setted else it'll be SPACE.
    So in the PAI u should read only the records where that flag is X:
    LOOP AT ITAB WHERE MARK = 'X'.
    ENDLOOP.
    Max

  • Selecting data in the table control

    Hi Friends,
    I have final data in my table control now the user wants to select only few records from the displayed data, for that I kept a check box for selection, But my question is I am unable to read the selected data.
    Actually user requirement is he has to update only the selected data from the displayed data in the table control.
    Can any one tell me how to read the selected records after displaying in the table control.
    Thanx in advance,
    Line

    Hello Line,
    As gopi has suggested do the following..
    for the table control properties u have an option called W/SelColumn.
    Give in some name (ROW_SEL)to that and also include a field CHK in the internal which is being passed to the table control.
    and in the PAI of the table control module wirte like this...
    Then in your code..
    PROCESS BEFORE OUTPUT.
    PBO FLOW LOGIC FOR TABLECONTROL 'TABCONTROL'
    MODULE TABCONTROL_CHANGE_TC_ATTR.
    MODULE TABCONTROL_CHANGE_COL_ATTR.
    LOOP AT lt_final
    INTO lw_final
    WITH CONTROL tabcontrol
    CURSOR tabcontrol-current_line.
    MODULE tabcontrol_get_lines.
    MODULE TABCONTROL_CHANGE_FIELD_ATTR
    ENDLOOP.
    MODULE status_0101.
    PROCESS AFTER INPUT.
    PAI FLOW LOGIC FOR TABLECONTROL 'TABCONTROL'
    LOOP AT lt_final.
    MODULE read_data.
    MODULE tabcontrol_user_command.
    ENDLOOP.
    MODULE TABCONTROL_CHANGE_TC_ATTR.
    MODULE TABCONTROL_CHANGE_COL_ATTR.
    MODULE user_command_0101.
    MODULE tabcontrol_user_command input.
    if lt_final-chek = 'X'.
    *put your logic here something like
    move corresponding lt_final to gt_final.
    *now you have selcted rows data in gt_final.
    endif.
    endmodule.
    Regards

  • How to select data from cluster table

    hi experts,
                   I have a report which picks data from bseg (cluster table ) for a month report it is taking around 4 minutes to process.I feel it is not good when take the report after some months.
    how to select data from these table???how to declare itab for these cluster tables????can we include any search condition or any other kind of internal table???
    please advice.
    mani

    Hi Manikandan,
    The following code may be helpful to understand how to select the data from cluster table.
    Types: Begin of ty_kna1,
    Kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_kna1,
    begin of ty_bseg,
    belnr type bseg-belnr,
    kunnr type bseg-kunnr,
    end of ty_bseg,
    begin of ty_final,
    belnr type bseg-belnr,
    kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_final.
    Data: it_kna1 type table of ty_kna1,
    wa_kna1 type ty_kna1,
    it_bseg type table of ty_bseg,
    wa_bseg type ty_bseg,
    it_final type table of ty_final,
    wa_final type ty_final.
    Select kunnr adrnr from kna1 into table it_kna1 where....
    if sy-subrc = 0.
    select belnr kunnr into table it_bseg for all entries in it_kna1 where kunnr = it_kna1-kunnr.
    endif.
    sort it_kna1 by kunnr.
    Loop at it_bseg into wa_bseg.
    move wa_bseg-belnr to wa_final-belnr.
    read table it_kna1 into wa_kna1 with kunnr = wa_bseg-kunnr binary search.
    if sy-subrc = 0.
    move: wa_kna1-kunnr to wa_final-kunnr,
    wa_kna1-belnr to wa_final-belnr.
    endif.
    append wa_final to it_final.
    clear wa_final.
    endloop.
    Loop at it_final into wa_final.
    write: / wa_final-belnr, wa_final-kunnr, wa_final-adrnr.
    endloop.
    Reward if useful.
    Thankyou,
    Regards.

  • How to select data from structure

    how to select data from structure

    Hi Laxman,
    Structure holds single record of data. You can acess data by using the syntax <b>Structure-field</b>
    Please see sample.
    data: wa_mara  type mara.
    select *
              from  mara
              into wa_mara
              up to 1 rows.
    endselect.
    write:/ wa_mara-mandt,
             wa_mara-matnr,
             wa_mara-maktl.
    if helps plz reward points.
    Regards
    Bhupal Reddy

  • Export Of Data In The .CSV Format With Column Headings On Top

    I'm trying to export data in the .csv format from a report (Crystal Reports XI Release 2).  When I export the data, the heading appears in the first few columns on the left hand side (i.e. columns "A" thru "G") for every row, rather as a column heading on top.  These header describe the data beneath it.  I tried various combinations of export options.  The file needs an extension .csv (or .xls) for the tool that uses the data.  Any suggestions how I can accomplish this ?

    Abhishek,
    I tried to apply your solution, but forgot that the Crystal Reports support desk updated my version of Crystal Reports XI to Release 2 for a previous problem.  My CDs are Crystal Reports XI Release 1.  Now I can't export at all until I figure out how to turn on the export option.  I do have access to older version (version unknown) that came with one of business system.  The options it has are "Character", "Tab", and "Delimeter" for "Separated Values (CSV)".  It does not have the option that you mentioned.  Is there a similar option with this older version ?  Lastly, How can I turn on the "Export" for "Crystal Reports XI Release 2" ?  Thanks ! ! !

  • How to insert data to the specified row column of the multi column list box

    Hi All
    How do i insert data into the specified column of the multi cplumn list box?
    I have a table that containsall station nos and name.Then another table contains the data the various stations having at  for 24 hrs.That is 12 am to 11 pm.
    And i want to display each stations details as follows using a multi column list box/table
    My stationinfo table
    stnno   stnname......................
    s1           stn1
    s2            stn2
    s3             stn3
    The other table
    stnno      sysdatetime       data
    s1             12am                   1
    s2              12am                   4
    s1               1  am                 2
    So the station s1,s2.... will have data for 24 hrs.
    And i want to display it as follows using a multicolumn listbox
    stnname        12am   1 am ......................................11pm
    s1                   ...................
    s2                 ........................
    What i have in my  mind is to get all station nos
    and in a for loop get the station's data from 12 am to 11 pm
    or
    select every statios data for each hor.But in this case i have to query the database 24 times.So i dont think its a good way.
    Or any other better query available?
    Can anybody suggest me a good idea?
    One more thing...how to insert data into the specified field row or column of a multi column list box?
    Thanks in advance

    hi
    i want to know,,can u say ur need clearly...and i attached two image u see that one
    Indrajit
    | [email protected] | [email protected] .
    Attachments:
    station.JPG ‏35 KB
    station2.JPG ‏79 KB

  • How to extract data in a given format

    Hi,
    Can anyone help me to get the data in the given format. Any Help will be highly appreciated.
    entity          instance          id_1 Type_1 Val
    ert_enquiry     SAP_096_0980_K     or_Cost          currency     128.0
    ert_enquiry     SAP_096_0980_K     ort_cur_sum     currency     145.0
    ert_enquiry     SAP_096_0980_K     ort_cur_on          currency     125.0
    ert_enquiry_1 AAP_011_0865_G     or_Cost          currency     108.0
    ert_enquiry_1 AAP_011_0865_G     ort_cur_sum     currency     126.0
    ert_enquiry     _1 AAP_011_0865_G     ort_cur_on          currency     115.0
    Database 11g ver 11.2.0.2.0
    with t as(
    select xmltype(
    '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:i24n="http://www.w3.org/2005/09/ws-i24n"
    xmlns:typ="http://oracle.com/determinations/server/10.3/rulebase/assess/types">
    <SOAP-ENV:Header>
    <i24n:international>
    <i24n:locale>en_US</i24n:locale>
    <i24n:tz>GMT-0700</i24n:tz>
    </i24n:international>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <typ:assess-response>
    <typ:global-instance>
    <typ:entity id="ert_enquiry">
    <typ:instance id="SAP_096_0980_K">
    <typ:attribute id="or_Cost" type="currency" inferred="true">
    <typ:number-val>128.0</typ:number-val>
    </typ:attribute>
    <typ:attribute id="ort_cur_sum" type="currency" inferred="true">
    <typ:number-val>145.0</typ:number-val>
    </typ:attribute>
    <typ:attribute id="ort_cur_on" type="currency" inferred="true">
    <typ:number-val>125.0</typ:number-val>
    </typ:attribute>
    </typ:instance>
    </typ:entity>
    <typ:entity id="ert_enquiry_1">
    <typ:instance id="AAP_011_0865_G">
    <typ:attribute id="or_Cost" type="currency" inferred="true">
    <typ:number-val>108.0</typ:number-val>
    </typ:attribute>
    <typ:attribute id="ort_cur_sum" type="currency" inferred="true">
    <typ:number-val>126.0</typ:number-val>
    </typ:attribute>
    <typ:attribute id="ort_cur_on" type="currency" inferred="true">
    <typ:number-val>115.0</typ:number-val>
    </typ:attribute>
    </typ:instance>
    </typ:entity>
    </typ:global-instance>
    </typ:assess-response>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>') col
    from dual)
    select x.*
    from t,
    xmltable(XMLNamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS "SOAP-ENV"
    , 'http://oracle.com/determinations/server/10.3/rulebase/assess/types' AS "typ")
    , 'SOAP-ENV:Envelope/SOAP-ENV:Body/typ:assess-response/typ:global-instance/descendant::typ:attribute'
    passing t.col
    columns
    id_1 varchar2(100) path '@id',
    type_1 varchar2(100) path '@type',
    val varchar2(100) path '.'
    ) x
    Thanks
    Ankith

    hi odie_63      
    i also don't reproduce
    Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0
    SQL> with t as
      2   (select xmltype('<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      3  xmlns:i24n="http://www.w3.org/2005/09/ws-i24n"
      4  xmlns:typ="http://oracle.com/determinations/server/10.3/rulebase/assess/types">
      5  <SOAP-ENV:Header>
      6  <i24n:international>
      7  <i24n:locale>en_US</i24n:locale>
      8  <i24n:tz>GMT-0700</i24n:tz>
      9  </i24n:international>
    10  </SOAP-ENV:Header>
    11  <SOAP-ENV:Body>
    12  <typ:assess-response>
    13  <typ:global-instance>
    14  <typ:entity id="ert_enquiry">
    15  <typ:instance id="SAP_096_0980_K">
    16  <typ:attribute id="or_Cost" type="currency" inferred="true">
    17  <typ:number-val>128.0</typ:number-val>
    18  </typ:attribute>
    19  <typ:attribute id="ort_cur_sum" type="currency" inferred="true">
    20  <typ:number-val>145.0</typ:number-val>
    21  </typ:attribute>
    22  <typ:attribute id="ort_cur_on" type="currency" inferred="true">
    23  <typ:number-val>125.0</typ:number-val>
    24  </typ:attribute>
    25  </typ:instance>
    26  </typ:entity>
    27  <typ:entity id="ert_enquiry_1">
    28  <typ:instance id="AAP_011_0865_G">
    29  <typ:attribute id="or_Cost" type="currency" inferred="true">
    30  <typ:number-val>108.0</typ:number-val>
    31  </typ:attribute>
    32  <typ:attribute id="ort_cur_sum" type="currency" inferred="true">
    33  <typ:number-val>126.0</typ:number-val>
    34  </typ:attribute>
    35  <typ:attribute id="ort_cur_on" type="currency" inferred="true">
    36  <typ:number-val>115.0</typ:number-val>
    37  </typ:attribute>
    38  </typ:instance>
    39  </typ:entity>
    40  </typ:global-instance>
    41  </typ:assess-response>
    42  </SOAP-ENV:Body>
    43  </SOAP-ENV:Envelope>') col
    44      from dual)
    45  --
    46  select  b.entity, c.instance, d.*
    47    from t,
    48         xmltable(XMLNamespaces('http://schemas.xmlsoap.org/soap/envelope/' as "SOAP-ENV",
    49                                'http://oracle.com/determinations/server/10.3/rulebase/assess/types' as "typ"),
    50                  'SOAP-ENV:Envelope/SOAP-ENV:Body/typ:assess-response/typ:global-instance/typ:entity'
    51                  passing t.col
    52                  columns entity varchar2(100) path '@id',
    53                          res_tmp2 xmltype path 'typ:instance') b
    54        ,xmltable(XMLNamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS "SOAP-ENV",
    55                                'http://oracle.com/determinations/server/10.3/rulebase/assess/types' AS "typ"),
    56                  'typ:instance'
    57                   passing b.res_tmp2
    58                   columns instance varchar2(100) path '@id',
    59                           res_tmp3 xmltype path 'typ:attribute') c
    60        ,xmltable(XMLNamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS "SOAP-ENV",
    61                                'http://oracle.com/determinations/server/10.3/rulebase/assess/types' AS "typ"),
    62                  'typ:attribute'
    63                   passing c.res_tmp3
    64                   columns id_1 varchar2(100) path '@id',
    65                           type_1 varchar2(100) path '@type',
    66                           val varchar2(100) path '.'
    67                  ) d
    68  /
    ENTITY                                                                           INSTANCE                                                                         ID_1                                                                             TYPE_1                                                                           VAL
    ert_enquiry                                                                      SAP_096_0980_K                                                                   or_Cost                                                                          currency                                                                         128.0
    ert_enquiry                                                                      SAP_096_0980_K                                                                   ort_cur_sum                                                                      currency                                                                         145.0
    ert_enquiry                                                                      SAP_096_0980_K                                                                   ort_cur_on                                                                       currency                                                                         125.0
    ert_enquiry_1                                                                    AAP_011_0865_G                                                                   or_Cost                                                                          currency                                                                         108.0
    ert_enquiry_1                                                                    AAP_011_0865_G                                                                   ort_cur_sum                                                                      currency                                                                         126.0
    ert_enquiry_1                                                                    AAP_011_0865_G                                                                   ort_cur_on                                                                       currency                                                                         115.0
    6 rows selected
    SQL>

  • How to select date while Updating record

    I Have created Validation through user api hook on Performance Management Module.but when user enter objective ,if is greater then or less then hundred then system raise error as per policy,but when user enter another objective to meet 100 percent then system raise error "hr object lock " because i am using select statement to sum of that object ,any body idea how to select date while inserting or updating any record.
    Thansks.

    Hi,
    drag and drop a af:convertDateTime on top of the select inputDate component
    <h:form>
    <af:selectInputDate label="Label 1">
    <af:convertDateTime pattern="yyyy-MM-dd hh:mm"/>
    </af:selectInputDate>
    </h:form>
    This adds the current time to the selected dat. In JDeveloper 11 you will be able to explicitly change the time in the calendar
    Frank

  • Is that possible to display the user selection data in the printable page?

    Hi All,
    I'm going to add a printablepage button on my page.
    Here comes a questions.
    Is that possible to display the user selection data in the printable page?
    For example,
    I have a table in the page,with 10 records.User select 5 of them.Can I display these 5 records in the printable page?
    Please help.

    Hi Yannick,
    Thanks a lot for the information. It worked.
    The portlet data can be accessible using bindings, but parameter name can be different.
    Meanwhile I have got one more scenario, where the Portlet and Task Flow placed in different pages of WCP Application. On change of data in the Portlet the application should navigate to another page where the Task Flow placed and displays selected data.
    Basically I can not use any button for navigation. The navigation should happen once I do some action in Portlet.
    Is this possible? If yes can you please let me know the steps?
    Thanks in advance!
    Somnath
    Edited by: Somnath Basak on Dec 20, 2011 9:41 AM

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

Maybe you are looking for