How to display the first 5 rows with a specific filter

Hi all
Please take a look at the below mentioned query.
select * from emp where empnm like 'B%';
Now suppose that it will display 10 lines. But I want to display 5 rows out of them.
How can I do? I tried with rownum and rowid. It worked because the files are in order,
But if these records are arbitrary order, now what? What should be done here?


Kind regards
BS2012.

ASO
I changed my query, this is the correct way to refer, and you must provide the exact column based on which you assume documents are old or new, in descending order.

Thank you!
Ashutosh

Tags: Database

Similar Questions

  • How to display the first page first and two pages (back and front) then?

    Hello

    I use acrobat 9 (Beginner).

    I have a document that should be displayed as"a book", IE two pages on the screen at the same time, the back of the first sheet and the front of the second.

    The problem I have is to display the cover on a single page (only) and then to have the layout of double page as described above.

    How I do that?

    Thanks for your help

    Concerning

    Fanch

    Entry of the menu View > Page Display > Show covers...

  • How to display the column single line with function of nested groups

    SQL > select deptno, Max (sum (sal)) SalSum
    2 of PEM
    3 Group of deptno;
    Select deptno, Max (sum (sal)) SalSum
    *
    ERROR on line 1:
    ORA-00937: not a single group group function

    Can you please help me to get the Max (sum (sal)) with Deptno...

    Or:

    select max(deptno) KEEP (DENSE_RANK LAST ORDER BY SalSum) deptno,
    max(SalSum) from  (
      select deptno,sum(sal) SalSum
      from emp
      group by deptno
    );
    
  • How to display the first value in the line in the second row and the second value of the line on the third row and so on...

    Hi all

    I have a requirement as below.

    Select * from my_tab;

    col1 col2 col3

    1 test1 January 1, 2014

    Test2 2 2 January 2013

    3 test5 February 9, 2015

    I need to display it as below.

    col1 col2 col3 req_col

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

    1 test1 January 1, 2014

    2 test2 January 2, 2013 January 1, 2014

    3 February 9, 2015 test5 January 2, 2013

    So how do?

    If it is not possible with sql then suggest me to do in peblisher xml (in rdf or rtf)

    Hello

    jagadekara wrote:

    Hi all

    I have a requirement as below.

    Select * from my_tab;

    col1 col2 col3

    1 test1 January 1, 2014

    Test2 2 2 January 2013

    3 test5 February 9, 2015

    I need to display it as below.

    col1 col2 col3 req_col

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

    1 test1 January 1, 2014

    2 test2 January 2, 2013 January 1, 2014

    3 February 9, 2015 test5 January 2, 2013

    So how do?

    If it is not possible with sql then suggest me to do in peblisher xml (in rdf or rtf)

    In SQL, you can use the analytic LAG function.

    http://docs.Oracle.com/database/121/SQLRF/functions093.htm#sthref1544

    Because I don't have a copy of your table, I'll use scott.dept to illustrate:

    SELECT DeptNo

    dname

    loc

    , Trolling (loc) over (ORDER BY deptno) AS prev_loc

    OF scott.dept

    ORDER BY deptno

    ;

    Output:

    DEPTNO DNAME LOC PREV_LOC

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

    10 ACCOUNTS NEW YORK

    SEARCH 20 DALLAS NEW YORK

    30 SALES CHICAGO DALLAS

    40 OPERATIONS BOSTON CHICAGO

  • How to display the first capital letter.

    Hi all


    I want when I get lowercase letter in the field, and it displays for me first capital letter.e.g (g)

    GB 1 it show G01.


    Please help me.


    Sarah

    Hi Sarah!
    If you enter just a letter and numbers in your article,
    You can set the element of Restriction of case property to UPPERCASE.
    Concerning

  • How to display the path of a contact with a program?

    How to display the path of a contact with a program?

    Hey,.

    Follow the mentioned below as follows:

    1. Go to Contacts > Contacts.
    2. Highlight the contact to which you want to see the way through the program.
    3. Click on the newspaper story > program activity.

    Thank you...

  • Ignore the first n lines with locked back.

    TimesTen is used from Java using the client-server access. We need to replicate the lines of TimesTen to a different database.

    We have lines of parallel job processing. During the treatment, the rows are locked:

    N FIRST SELECT * FROM TABLE_X FOR UPDATE

    The problem is that the first task selects and locks the first n rows and other jobs must wait until the locks are released. Is it possible to skip lines locked, so the other jobs would choose another set of lines.

    With Oracle, this can be accomplished by using the SKIP LOCKED clause. Locked IS NULL clause with SQL Server by using WHERE.

    Is it possible to have this kind of behavior in TimesTen?

    Is there another solution for replication of the lines? XLA API seems to be for this, but it seems a little complicated and use the direct access, which is not appropriate for our facility.

    Thank you

    Unfortunately, TimesTen doesn't have an option to ignore locked rows. I'm guessing that the "another database" is not Oracle? In this case, you can use a cache AWT group. XLA (or JMS/XLA for Java) really is the best option to "reproduce" in terms of performance, etc.. It is true that use the component which performs the "replication" to run on the computer where TimesTen runs, but the rest of the application would not have to do. Live view you the spirit gives much better performance :-)

    If you really need to do it through SQL, then you will need to find a way to get different jobs watch different sets of rows without locking up. Exactly how you could of course a lot depends on the application and exactly what he's trying to do. One approach would be to have a column in the table to identify what "Replicator" currently dealing line. You can use NULL means that it is not being processed and an ID value (could just be a number) to indicate that Replicator 1 (or 2 or 3 or...) is the treatment. Replicator ' wouldn't 'reserve' a set of rows to update it column "n" and commit. He would then do its job and then update the column again to another value which means "made replication." This can work very well or may not depending on what the application should do with lines, etc.

    Chris

  • Displays the number of rows in the table displaying a named criteria query data

    I created a test named for my View, called 'Criteria1' and Criteria1 to create a group of ADF with Table query. I want to display the number of rows in result when a search is performed. How can I do?

    Thanks in advance,
    Tom

    As mentioned, you can add outputText and you must give OutputText partialTriggers as query component your Id. Thus, when you give a search on the query component, it will refresh the outputText with the number of lines.


    ID = "ot1" partialTriggers = "id of the component of motion here" / > ""

  • How to display the results in the order based on the value of research

    Hi all

    How to display the results in the slot order.
     
    
    CREATE TABLE TEST( SONGID  NUMBER, TITLE   VARCHAR2(200))
    
    INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
    INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
    INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');     
    INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
    INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
    
    SELECT *FROM  TEST WHERE INSTR (TITLE, 'MADONNA') > 0
    
    output: 
    SONGID     TITLE
    10     AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    11     CICCONE, MADONNA (CA)
    12     DALLIN, MADONNA LOUISE/STOCK
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    16     MIRWAIS AHMADZAI, MADONNA
    17     MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
    18     MADONNA (CA),CICCONE
    
    Expected output :
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    18     MADONNA (CA),CICCONE
    ..
    ..
    ..
    ..
    ...
    If the user makes a search with "MADONNA", I view the results as title begins with "MADONNA" first then the rest of the records.
    Please let me know is possible to show the results in this order.


    Kind regards
    Rajasekhar

    This can be a little more specific:

    SQL> SELECT *
      2  FROM   TEST
      3  WHERE  INSTR (TITLE, 'MADONNA') > 0
      4  ORDER  BY INSTR (TITLE, 'MADONNA')
      5           ,TITLE
      6  ;
    
                  SONGID TITLE
    -------------------- --------------------------------------
                      13 MADONNA
                      14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
                      15 MADONNA (CA)
                      18 MADONNA (CA),CICCONE
                      12 DALLIN, MADONNA LOUISE/STOCK
                      11 CICCONE, MADONNA (CA)
                      17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
                      16 MIRWAIS AHMADZAI, MADONNA
                      10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    
  • How to display the rownum in oracle forms?

    Hai all,

    How to display the rownum in oracle forms?

    Thank you
    RCS
    ----------------

    I would add rowum with the current form of group_mstr:

    former columns:

    group_id
    GroupName

    new columns will be:

    identifier of the line
    group_id
    GroupName


    I created as follows:
    in forms
    text tool > row id
    text element > EXT_ITEM20

    error text element: no white color, it's a different color
    --------------

    create > Trigger > a time new form instance > I gave like this:

    DECLARE
    CURSOR crrow_id IS
    SELECT count (*) + 1 group_mstr;
    BEGIN
    OPEN crrow_id.
    Search FOR crrow_id IN: TEXT_ITEM20;
    CLOSE Crrow_id;
    END;
    ------------
    error: identifier group_mst must be declard
    ============

    I don't know also not quite what you want to display in your form. Do you want to just number the records displayed, from 1 to n?

    If so, create a text whose property 'data base element' element to the value 'no', "calculation method" formula and the formula itself: SYSTEM. " TRIGGER_RECORD, then, in each case, the registration number should be indicated.

  • How to display the drop-down list box in MS excel by using labview report generation toolkit? pleasepost code block diagram?

    How to display the drop-down list box in MS excel by using labview report generation toolkit? Please post the block diagram of the code so that I can able to generate from the drop-down list box in excel with the menu drop-down...

    Like this. (edition, use the reference forms instead of the reference to the worksheet)

    Ben64

  • How to display the list of components in ultiboard 10?

    The DRC report the errors where the components that are no longer in the design have been removed. How to display the list component and then remove them from the netlist to stop this?

    Ultiboard reported missing errors of component (part 'X' is not about design) because the part is always referenced by a net. To fix this, you must remove the part of the net. Following the steps below to remove the part form the net.

    1 tools > Netlist Editor

    2. for each network that the part has been connected to, select the Net (upper-left).

    3. Select the tab of pine trees, select the part and it is the PIN in the dialog box, then click on remove

    The problem is when the part is removed, I see no easy way to determine the threads you need to remove the part of. I entered this as a feature request to make this easier, but as a workaround, you can put part and say Ultiboard what the missing part, then search the net names on the pins and remove the part of these pins

    1 place a piece with a lot of pine trees (for example the part that was removed, or for example through Hole technology > Connectors > SIL & headers > HEADER2X9). When you place the part, make sure that the RefDes matches the RefDes of the part which has been removed.

    2. once the room is placed, you should see rats nest lines that connect the part to the nets.

    3 Zoom on the pins. You should now see the net name on each of the axes. For each of the pins connected, remove it from the net as described above.

    4. remove the part that you placed.

  • How to display the name of my refnum on the front?

    I write data to a file. To do this, I use ' Open/create/replace the file' to prompt the user for a file name, which is then out of my VI as a refnum. I then write strings in this file with "write to a text file.

    How to display the name of the file (including the path) on the front panel once the user has entered it?

    Michael

    Use the Refnum at the path of e/s from file-> advanced file palette. You can wire it to a path indicator.

  • Columns of folder: by default, how can return the first column 'Name' without having to move it manually every time?

    Something's happened awhile and when I create a folder which appears the first column is the column 'Date modified '. By default, how can return the first column 'Name' without having to move it manually every time?

    Hello

    I suggest you to visit these links and check if it helps:

    http://Windows.Microsoft.com/en-us/Windows-Vista/working-with-files-and-folders#section_4

    http://Windows.Microsoft.com/en-us/Windows-Vista/folders-frequently-asked-questions

    It will be useful.

  • How to display the language bar and bring back the language switch to the taskbar?

    How to display the language bar and bring back the language switch to the taskbar?

    How to display the language bar and bring back the language switch to the taskbar?

    Hello

    According to the description, I understand that you do not want to display the language bar.

    I would like to know some information.

    1. You hide the language bar, or missing?

    I suggest you try the steps mentioned below and check.

    1. Go to the control panel.

    2. Click on clock, language and region.

    3. Region and language.

    4. Keyboard and language tab.

    5. Change keyboards button.

    6. Language bar tab.

    Then simply change the parameters of language bar hidden in the "embedded in the taskbar" and check.

    Here, you can also check the option in the check box for display icons of language in addition to the taskbar bar.

     

    Hope this information helps. Please let us know if you need any other help with Windows in the future. We will be happy to help you.

Maybe you are looking for