How to get first row in query output

HI,
query:
select a.LOGIN,s2diq(a.created_t)
from service_t a,account_t b
where a.ACCOUNT_OBJ_ID0=b.POID_ID0
and b.ACCOUNT_NO='80161001'
and b.status =10100
output of query:
80161001     6/25/2011 2:00:43 AM
80161001_1     10/16/2011 9:10:44 PM
80161001_2     10/16/2011 9:36:02 PM
80161001_3     10/16/2011 10:23:07 PM
80161001_4     10/17/2011 9:41:34 PM
80161001_5     10/17/2011 9:45:59 PM
80161001_6     10/17/2011 10:26:27 PM
how to get only first row only in quaery:
Thanks
Prakash
Edited by: prakashdba on Apr 7, 2009 3:09 AM

Then how about this
select * from
     (select a.LOGIN,s2diq(a.created_t) secondcolumn
     from service_t a,account_t b
     where a.ACCOUNT_OBJ_ID0=b.POID_ID0
     and b.ACCOUNT_NO='80161001'
     and b.status =10100
     order by COLUMN_NAME) A
where rownum=1;

Similar Messages

  • How to get first row from View Object cache.

    hi,
    I am using Jdeveloper 11.1.1.6
    can we get first row from View Object cache??
    Thanks in Advance.
    Best
    Shashidhar

    Hi Frank,
    Thanks for reply!!
    My case is:
    I have a Query based ViewObject.
    One of the field is LOV and remaining fields are in ADF table. the LOV field is out side ADF table when i insert first record in ADF table and i choose LOV  filed the value is selected.
    when i create second row LOV value got refreshed because both are in same VO.
    I need to get the LOV value of first row and set same value to second Row.
    Shashidhar

  • How to get first row from view iterator programatically?

    Hi All,
    I am using Jdeveloper 11g Release 2.
    I want to fetch the first row of a view iterator in a bean. Can any one guide me through this use case.
    Any help will be highly appreciated.
    Thanks ... Best Regards
    Bilal

    Use the code snippet as below:
    *// 1. Access the binding container*
    DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    *// 2. Find a named iterator binding*
    DCIteratorBinding iter = (DCIteratorBinding)bc.findIteratorBinding("<ITERATOR_NAME>");
    *//3. Get the RowSetIterator Object*
    RowSetIterator rsi = iter.getRowSetIterator();
    *//4. Get the First Row*
    Row firstRow = rsi.first();
    Thanks,
    Navaneeth

  • How to get first row of a dataobject

    I have a ListDataObjectList that I’m setting in the request object. In the UIX page there is one field that is the same in all rows and hence I want to display only once. I have the following code in my UIX page, but it displays duplicate values (one from each row). How can I suppress repeating values?
    <rowLayout hAlign="center">
    <contents childData="${sessionScope.accounts}">
    <html:b>
    <formattedText text="${uix.current.customerSSN}" styleClass="OraDataText"/>
    </html:b>
    </contents>
    </rowLayout>
    Any help would be very much appreciated.

    You can use array notation in EL to access the first item (since it is duplicated).
    <rowLayout hAlign="center">
    <contents>
    <html:b>
    <formattedText text="${sessionScope.accounts[0].customerSSN}" styleClass="OraDataText"/>
    </html:b>
    </contents>
    </rowLayout>
    Kind Regards.

  • How to display first row value returened from a query as checked as default in a report

    How to display first row value returned from a query as checked as default in a report
    Example
    Parameter 1
    Paramerter2
    ABD
    x(checked)
    Test
    DEF
    JMG
    Mudassar

    Hi Mudassar,
    The issue is caused by the order in which the parameters appear in the report data tab can be difference between our report execution and it failing. In other words, “Parameter2” is execution before parameter “A” due to this issue. We can adjust the parameter’s
    order to solve the issue.
    If “Parameter2” is parameter “A”, we cannot use that expression. Because fields cannot be used in report parameter expression, if we want to display the first value returned from a query as default value, we have to fill the “Specify values” text box with
    the specific value in Default Values dialog box.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • How to get fourthly row (row4) first column value (col1) in matrix

    Hi to all,
    In FMS, how to get fourthly row (row4) first column value (col1) in matrix in document.
    select $[$38.1.4]
    But it display the first row
    Please give me hint.
    Thank you

    Hi Eric,
    FMS may only apply to current row.  There is no way to get any other fixed row.
    Thanks,
    Gordon

  • How to get check box in alv output

    hi gurus
    can anyone explian me how to get check box in alv output
    it should not be a pop up window
    i want to get in output itself
    tahnk you
    regards
    kals.

    Hi
    by using rs_selfield
    ty to call dynamic subroutine..
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield. "#EC CALLED
    read table rs-selfield with key cond = 'X'
    endform.
    see the below example
    REPORT Z_GET_REFRESH no standard page heading.
    type-pools : slis.
    tables : makt,
    mara.
    data : i_fieldcat type slis_t_fieldcat_alv.
    CONSTANTS :
    gc_refresh TYPE syucomm VALUE '&REFRESH'.
    data : begin of i_makt occurs 0,
    matnr like makt-matnr,
    maktx like makt-maktx,
    end of i_makt.
    data : v_repid like sy-repid,
    g_user_command type slis_formname value 'USER_COMMAND',
    g_status_set type slis_formname value 'SET_PF_STATUS',
    lt_event_exit TYPE slis_t_event_exit,
    ls_event_exit TYPE slis_event_exit.
    DATA:LC_GLAY TYPE LVC_S_GLAY.
    select-options s_matnr for mara-matnr .
    start-of-selection.
    select matnr maktx from makt into table i_makt
    where matnr in s_matnr.
    end-of-selection.
    Fill the fieldcatlog
    perform fill_field.
    Call the FM
    perform call_fm.
    *& Form fill_field
    text
    --> p1 text
    <-- p2 text
    FORM fill_field.
    data wa_fieldcat type slis_fieldcat_alv.
    clear : wa_fieldcat.
    wa_fieldcat-tabname = 'I_MAKT'.
    wa_fieldcat-fieldname = 'MATNR'.
    wa_fieldcat-outputlen = '18'.
    wa_fieldcat-seltext_l = 'Material #'.
    wa_fieldcat-col_pos = '1'.
    append wa_fieldcat to i_fieldcat.
    clear : wa_fieldcat.
    wa_fieldcat-tabname = 'I_MAKT'.
    wa_fieldcat-fieldname = 'MAKTX'.
    wa_fieldcat-outputlen = '40'.
    wa_fieldcat-seltext_l = 'Material Desc'.
    wa_fieldcat-col_pos = '2'.
    append wa_fieldcat to i_fieldcat.
    ENDFORM. " fill_field
    *& Form call_fm
    text
    --> p1 text
    <-- p2 text
    FORM call_fm.
    v_repid = sy-repid.
    LC_GLAY-EDT_CLL_CB = 'X'.
    CLEAR ls_event_exit.
    ls_event_exit-ucomm = gc_refresh. " Refresh
    ls_event_exit-after = 'X'.
    APPEND ls_event_exit TO lt_event_exit.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = v_repid
    I_CALLBACK_PF_STATUS_SET = g_status_set
    I_CALLBACK_USER_COMMAND = g_user_command
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS = LC_GLAY
    IS_LAYOUT =
    IT_FIELDCAT = i_fieldcat
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT = lt_event_exit
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IT_ALV_GRAPHICS =
    IT_ADD_FIELDCAT =
    IT_HYPERLINK =
    I_HTML_HEIGHT_TOP =
    I_HTML_HEIGHT_END =
    IT_EXCEPT_QINFO =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = i_makt
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " call_fm
    FORM USER_COMMAND *
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield. "#EC CALLED
    data i_RSPARAMS like RSPARAMS occurs 0.
    CASE R_UCOMM.
    WHEN '&IC1'.
    read table i_makt index rs_selfield-tabindex.
    SET PARAMETER ID 'MAT' FIELD i_makt-matnr.
    if not i_makt-matnr is initial.
    call transaction 'MM02' and skip first screen.
    endif.
    when '&REFRESH'.
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
    CURR_REPORT = v_repid
    IMPORTING
    SP =
    TABLES
    SELECTION_TABLE = i_RSPARAMS
    EXCEPTIONS
    NOT_FOUND = 1
    NO_REPORT = 2
    OTHERS = 3
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    submit z_get_refresh with selection-table i_RSPARAMS.
    rs_selfield-refresh = 'X'.
    ENDCASE.
    MOVE '&REFRESH' TO r_ucomm.
    ENDFORM.
    FORM set_pf_status *
    FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
    DELETE Rt_extab WHERE fcode = gc_refresh.
    SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'
    EXCLUDING Rt_extab.
    *SET PF-STATUS 'STANDARD' EXCLUDING rt_extab.
    SET TITLEBAR sy-tcode.
    ENDFORM.

  • How to get key from MDX Query

    Hi All,
    how to get key from mdx query ?
    example :
    SELECT [Measures].[67822GFASOU7KUT6FKHSQ34FV] ON COLUMNS NON EMPTY CROSSJOIN([ZCOMPANY].MEMBERS, [ZMILL].MEMBERS) ON ROWS FROM ZODS_GL/ZODS_GL_001
    the result from this mdx query are zcompany text and zmill text, how to get company key and mill key ?
    Regards
    JeiMing

    hi Jeiming,
    to get key in mdx, you can try something like
    [ZCOMPANY].[LEVEL01].MEMBERS
    properties [ZCOMPANY].[2ZCOMPANY]
    following threads may useful
    Extracting texts with MDX
    MDX Statement - display only keys for characterstics and their dis. attrib.
    hope this helps.

  • How to get  visible row  count  in JTable ?

    I have one table which is added to one scroll pane. For example my table have total 1000 rows, but at a time only 20 rows should be visible to the scroll pane. And I want to scroll the rows and show only 20 at a time.When user scrolls JTable then next time he can view only 1 to 21, then 2 to 22, and so on. I want to know how to get that number which represents the visible row( in this case it is 20).So kindly help me how to get visible row count. Any help regarding this will be appriciated.
    Thanks and Regards,
    Sheetal

    how to get visible row count.First you need to get the viewport used by the scrollpane. Then you can use methods like getViewPosition() and getViewSize() to get information about the current postition of and size of the viewport.
    Then you can use the table method getRowAtPoint(). to determine the first and last visible row which can then be used to calculate the visible row count.
    When user scrolls JTable then next time he can view only 1 to 21, then 2 to 22, and so onThis is the default behaviour when a "block" scroll is done.
    However when you click on the arrow button on the scrollbar it will only scroll a single row. You could override the getScrollableUnitIncrement() method to return the value from the getScrollableBlockIncrement() method.
    However the user can still drag the scrollbar manually which would cause a problem. So you would also need to remove the MouseMotionListeners from the scrollbar to prevent this.

  • How to make first row as selected in af:table

    Hi,
    I am using JDeveloper 11.1.1.4 and ADF-BC in my application.
    In all the pages across my application we have multi select enabled for the table[af:table].
    But when the pages are displayed,the first row is not selected by default.
    My requirement is to display first row as selected across all the tables in my app.
    I have the selectionListenerset as for example selectionListener="#{bindings.RSCMapVO2.collectionModel.makeCurrent}" in all the pages.
    Please suggest on how to make first row as selected.
    Regards,
    Praveen

    Hi
    Put these codes in your selection listner method(You have to define a selectionListner method in your backing bean and put this code segment
    (Special thanks go to Franks how posted this code segment. threadID=1089583)
    RichTable yourTable = (RichTable) selectionEvent.getSource();
    //the Collection Model is the object that provides the structured data
    //for the table to render
    CollectionModel yourTableModel = (CollectionModel) yourTable.getValue();
    //the ADF object that implements the CollectionModel is JUCtrlHierBinding. It
    //is wrapped by the CollectionModel API
    JUCtrlHierBinding yourTableBinding = (JUCtrlHierBinding) yourTableModel.getWrappedData();
    //Acess the ADF iterator binding that is used with ADF table binding
    DCIteratorBinding yourTableIteratorBinding = yourTableeBinding.getDCIteratorBinding();
    //the role of this method is to synchronize the table component selection
    //with the selection in the ADF model
    Object _selectedRowData = yourTable.getSelectedRowData();
    //cast to JUCtrlHierNodeBinding, which is the ADF object that represents
    //a row
    JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding) selectedRowData;
    //get the row key from the node binding and set it as the current row in the
    //iterator
    Key rwKey = nodeBinding.getRowKey();
    tableIteratorBinding.setCurrentRowWithKey(rwKey.toStringFormat(true));
    Thanks
    Padma

  • How to get  current row(Based on Radio button check)  submit button Click

    Hi i hava Query Region Search(Based On Auto Customization Criteria).
    For Showing Results iam Using Table Region.
    Using Radio button How we get the row reference value using Submit button Click.
    Please Help on this .
    Thanks & Regards
    San

    Hi san ,
    Try this
    if ("EventID".equals(pageContext.getParameter(EVENT_PARAM)))
    String rowRef = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    OARow row = (OARow)am.findRowByRef(rowRef);
    VORowImpl lineRow = (YourVORowImpl)findRowByRef(rowRef); // Replace your vo name .
    Please refer this link , Let me know if its not clear .
    Single Selection in table Region in OAF .
    Keerthi

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • How to get selected  row index  of a Table ?

    hi gurus,I'm new  to Webdynpro for abap
    I'm displaying    just Flight details in a Table  so
    how to get selected  row index  of a  Table  and need  to be display in Message manager.

    Hi,
    For getting the row index use the following code.
    DATA lo_nd_node TYPE REF TO if_wd_context_node.
      DATA lo_el_node TYPE REF TO if_wd_context_element.
      DATA index TYPE i.
    * navigate from <CONTEXT> to <NODE> via lead selection
      lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
      lo_el_node = lo_nd_node->get_lead_selection(  ).
      index = lo_el_node->get_index( ).
    node is the name of the node which is binded to the table.
    For printing the message u can use code wizard.
    Press ctrl-F7. Now Select generate message.
    IN this select the method  REPORT_SUCCESS
    In the code now u can give index to Message text Exporting parameter. Comment receiving parameter.
    Write the whole code in onLeadSelect of the table.
    Regards,
    Pankaj Aggarwal

  • How to get all rows in table to red using alternate rows properties option

    How to get all rows in table to red using alternate rows properties option

    Hi Khrisna,
    You can get all rows red by selecting the color red in the "Color" and "frequency" to 1 under the "Alternate Row/Column colors".
    I tried doing it and the colors freaked me out (all red) :-D
    Kindly tell me if im missing something.
    Regards,
    John Vincent

  • How to get selected row keys from RichSelectManyCheckbox

    Adf Table has getSelectedRowKeys but SelectManyChekcbox does not has anything similar. Can you tell me how to get selected row keys programmatically for RichSelectManyCheckbox?

    Hi User,
    selectManyCheckbox component's value property holds the selected items values. Bind this property to some bean variable(of type list) so that you can get the selected values by accessing the bean property.
    Sireesha

Maybe you are looking for