Select * from (select * from.....) ........problem

Hi all!
I am facing a prob while designing a query:
I have a table named ind_mtr with column named "seq_no"....seq_no has a unique index.
I want to arrange the data by seq_no in desc order and from arranged data i want to select first 500 records. For this purpose i supplied the following query:
select seq_no from (select seq_no from ind_mtr where rownum<501)
order by seq_no desc;
But it is giving me wrong results...it selects first 500 records in database and then arranges them in desc order with respect to seq_no.
Can anybody tell me how can i solve this...
Riaz

Since the 1st 500 rows in descending order on seq_id represents the 500 max values of seq_id, you really want something like the following: SELECT * FROM <tablename> where seq_id BETWEEN ( SELECT MAX( seq_id ) - 500 FROM <tablename> ) AND (SELECT MAX(seq_id) FROM <tablename> ); Or you could put into 2 queries in anonymous block. There is probably a better way. You should look into SQL For Smarties and SQL Puzzles and Answers by Joe Celko. Hope this helps.

Similar Messages

  • Problem in getting parameter value from selection screen in web dynpro abap

    Hi,
    I am facing problem in getting parameter value from selection screen.
    Please find my code below:
    DATA LT_PAR_ITEM TYPE IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM.
    FIELD-SYMBOLS:<FS_PAR_ITEM> LIKE LINE OF LT_PAR_ITEM,
                                 <FS_OBJ_USAGE>    TYPE REF TO data.
      WD_THIS->M_HANDLER->GET_PARAMETER_FIELDS( IMPORTING ET_FIELDS = LT_PAR_ITEM ).
      LOOP AT LT_PAR_ITEM ASSIGNING <FS_PAR_ITEM>.
        CASE <FS_PAR_ITEM>-M_ID.
          WHEN `OBJ_USAGE`.
             ASSIGN <FS_PAR_ITEM>-M_VALUE->* TO <FS_OBJ_USAGE>.      
    [ Here, sy-subrc is 4,  <FS_OBJ_USAGE> is not assigning.]
        ENDCASE.
      ENDLOOP. 
    So, can any one solve this problem.
    Thanks in advance,
    Radhika

    Hi Radhika,
    Try using GET_RANGE_TABLE_OF_SEL_FIELD...
    Please Refer below code..
       DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA: RT_CARRID TYPE REF TO DATA.
      DATA: ISFLIGHT TYPE TABLE OF SFLIGHT.
      DATA: WSFLIGHT TYPE SFLIGHT.
      FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE.
    Retrieve the data from the select option
      RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
    Assign it to a field symbol
      ASSIGN RT_CARRID->* TO <FS_CARRID>.
      CLEAR ISFLIGHT. REFRESH ISFLIGHT.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE ISFLIGHT FROM SFLIGHT
                           WHERE CARRID IN <FS_CARRID>.
      NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( NAME = `FLIGHTS` ).
      NODE_FLIGHTS->BIND_ELEMENTS( ISFLIGHT ).
    Thanks,
    Regards,
    Kiran

  • I just paid for Adobe PDF pack and I think I am having problems installing. When I select to print from word, PDF is not an option. Help!

    I just paid for Adobe PDF pack and I think I am having problems installing. When I select to print from word, PDF is not an option. Help!

    Hi voltric2014,
    If you are on Windows, you can download and install the CreatePDF Desktop Printer, which would allow you to "print" to PDF from Word. You'll find a link to the installer on the CreatePDF page at https://cloud.acrobat.com. Here are the instructions for installing it: Using Adobe PDF Pack
    Please let us know if you have additional questions.
    Best,
    Sara

  • Problem in selecting my Applet from apdutool input script

    Hi...
    I am havivg problem in selecting my Applet from apdutool input script . It always sending status reponse of 6D00... Plz help...
    I am very new to Java card....
    When ever my selecting installer applet its working fine ....status reponse 90 00....
    thanz in Advance

    Hi, i'm having the same problem with my applets, i can't resolve this problem, pleace help us

  • Heres a new one !make path from selection  adobe CS4 problems

    Hello   Ive had CS4 for about a week and i Tried make a path from selection with alliptical tool and it comes out all wonky  only rectangle tool is true to the its shape anything else is bugged. Ive deleted the settings folder on start up,reinstalled , tried all tolerence levels, reinstalled video card driver(nvidia 7600 gt) and turned on and off gl. Has anyone experienced this, can anyome help me?
    cheers

    bochansan wrote:
    That was the first thing I checked . Can someone else help? it would be a pity to give up so quick .Does uninstalling and and using a cleaner help? if so what does one recommend?   
    OK. That method is not very good anyway.
    Make the path using the Ellipse tool set to Paths In the Options Bar.

  • Problem with "Create New Extrusion from Selected Layer" CC 2014

    Hello, I'm experienced with Photoshop but am new to 3D text in Photoshop.  I type in some text and convert to a shape.  When I choose Create New Extrusion from Selected Layer I get  dialog box I don't see in any tutorials.  It says "You are about to create a 3D layer.  Would you like to switch to the 3D workspace?  Yes/No, Don't show again."  Which should I use for 3D text? 
    If I choose Yes, all the panels go away and the content in the tool options bar (ribbon?) just under the menu bar go away.  I have to restart Photoshop to get the tool options back.  What could I be doing wrong?
    Thanks - Dave

    I just chose "No" and didn't look back.  I like my workspace just as it is, and don't prefer Photoshop to change it for me under this particular case.
    You can make the 3D panel visible yourself via Window - 3D.  I find it's a good alternate for the Actions panel, as I don't have any actions at the moment that work in the 3D world.
    The panels you'll want to see easily if you work on 3D are the 3D panel and the Properties panel, among a few others.
    Regarding getting your workspace back the way you like it...  Note the little selector near the upper-right corner of the Photoshop main window.  That can be used to select a workspace.  I suggest you experiment and get familiar with the concept of workspaces.  You can define your own and save it with a name, and that truly can be helpful.
    -Noel

  • Interesting though esoteric problem of the form 'select a * b from dual'

    Hi,
    Warning: The question is of very little practical significance.
    (There, I warned you!!)
    Database version: 10.2.0.4.0
    If I try to execute the following
    select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 999999999999999999999999999999999999999999
    from dualI get a 'ORA-01426: numeric overflow' error, which is fine.
    But if I try to execute the following(note the decimal point)
    select 3.14285712285715111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 * 7
      from dualI get a 'ORA-00923: FROM keyword not found where expected' error.
    Interestingly, if I remove any one digit from the first number(hence reducing its length by 1), the query works fine. Removing the spaces on either side of '*' still results in a 'ORA-00923: FROM keyword not found where expected' error though.
    Can anyone explain why?
    Regards,
    Sujoy

    Hi, Sujoy,
    There seems to be a limit of 255 characters (including decimal point) in a number literal. It doesn't seem to matter how m,any digits are before the decimal point and how many are after it. If you don't raise siome other error (such as "'ORA-01426: numeric overflow' error") first, then using a liteal with more than 255 characters will raise "'ORA-00923: FROM keyword not found where expected".
    Multiplying by 7 in your example doesn't matter; the compiler never gets that far, because the error occurs in the compilation.
    A sign doesn't matter, either, because signs are not part of the literal; they are operators applied to the value after the literal is evaluated. This is also evident because you can put withespace between the sign and the literal.

  • I have created a PDF form with multiple drop downs, all with the same drop down values. When I select a value from 1 of the drop down fields, it replicates in all of the others - which I do not want. How can I fix this?

    I have created a PDF form with multiple drop downs, all with the same drop down values. When I select a value from 1 of the drop down fields, it replicates in all of the others - which I do not want. Can I fix this?

    I'm fairly new to this, but I think it has to do with the way you have the drop downs named. Did you copy one then keep pasting it in each field? If so, that is the problem. You should rename each one with a different number: Dropdown1, Dropdown2, etc. I think that might solve the issue.

  • How to select several values from a user exit variable in a planning folder

    Hello,
    I have created a user exit variable for limiting the values only to which the user need to access.
    For a simulation part, it is then necessary for him to select several values from these values (not only one, and not all)
    But It seems in this case the user has only two possibilities :
    - keep all the values without any restriction
    - restrain the selection to only one value.
    It seems possible for the user to access to a multiple choice window, but this possibility doesn't seems to work : in all tests we did, only the first value was taken into account by BPS.
    If this method is not good do you know an other manner to permit the user to choice several values amongst a set of pre-selected  (because the original set is too important) values ?
    Thanks for your help.

    Hi Mayank,
    Thanks for your response, but I don't think it corresponds to my problem.
    I my case, I use a user exit variable to filter some data. It seems BPS offers the possibility to the user to select several values amongts the pre-selected values presented by the user exit variable, but it doesn't work. We can use a popup in which we enters the required values, but in final, only the first value is taken into account.
    I don't know if it is due to a BPS bug or if it is not a good solution in regard to BPS philosophy. In this case, the concerned caracteristic isn't in the header but in lead columns.
    I must present a solution to my client next monday, so I have not enough time to open an OSS message.
    An alternate solution should be interesting too.
    My need is to present to a user a selection of values amongst all values from an infoobject (the user exit variable seemed to be a good solution) and the user must have the possibility to select some values amongst these as filter.
    Regards

  • Auto selection of file from folder during uploading??

    Hi all friends,
    Iam facing with one problem I am developing one uploading software for that i have used swing and servlet.Now my problem is i want to give auto selection of file from one folder means user just copy the files from any computer on network and paste it in predefind folder.And when they click on upload button it should start uploading of file one by one and after completion of uploading it move that file into another folder one by one.Now my software doing it perfectly but if user copy and paste any file in that predifined folder from network computer during uploading then they have to click upload button again after completion of first queue of files(for example if user first copy 10 files and start uploading and inbetween uploading of that 10 files if user copy another 10 files from network computer then they have to click on upload button again after completion of uploading of first 10 files).But my user requirement is they want to click on upload button once only at the time of starting my application and my application automatically select the file one by one from folder and send it to destination.Means if they copy the file from network machine inbetween uploading or any other user from network send file in that folder then my application should select those file automatically and start uploading means they don't want to click on upload button again.Can any one plz guide how I can slove this problem.Below r my codes:-
    Upload.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    try {
    suspendflag=true;
    Resume.setEnabled(false);
    Suspend.setEnabled(false);
    dest=frame.m_txtURL.getText();
    File ff=new File("d:\\DTMS\\Upload");
    File[] files = ff.listFiles();
    fileList = new Vector();
    if(files == null)
    textArea.append("There is no file");
    return;
    else
    for (int j = 0 ; j< files.length ; j++)
    fileList.add(files[j]);
    java.util.Collections.sort(fileList, new FileComp());//sorting by size
    new Thread(new Runnable() {
    public void run(){
    for (int k = 0; k < fileList.size(); k++)//loop for queue {
    File fname = (File)fileList.get(k);
    String str=fname.getName();
    log("Destination:" +" "+ dest);
    log("Uploading Progress\nPlease Wait....");
    result=doPost(fname,dest);//method for read file & send to servlet
    String str2="Transfer apparently failed.";
    String str3=result;
    if(str2.equals(str3)){
    Error(result);
    else if(suspendflag==true){
    File newfile =new File("d:\\DTMS\\Archives\\"+str);
    fname.renameTo(newfile);
    log("File" +" "+ str+" "+"Upload Completed !");
    else if(suspendflag==false){
    Error("** Transfer Suspended**");
    }).start();
    }catch(Exception exp)
    Error("Error : " + exp.toString());
    Regards
    Bikash

    Hi Chandan,
                        All the multiselection files are stored in it_tab( i:e file_table in method). you need to loop the every record to upload the data for selected files. please check the code Below...
    DATA: file_str1 type string.
    data: it_tab TYPE STANDARD TABLE OF file_table,
           wa_tab TYPE file_table,
           lw_file LIKE LINE OF it_tab,
           gd_subrc TYPE i.
    SELECTION-SCREEN begin of block blk with frame title text-100.
    SELECTION-SCREEN SKIP 2.
    parameters : p_file like rlgrap-filename .
    SELECTION-SCREEN end of block blk.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
    window_title = 'Select only Text File'
    default_filename = '.azt'
    multiselection = 'X'
    CHANGING
    file_table = it_tab
    rc = gd_subrc.
    *READ TABLE it_tab INTO lw_file INDEX 1.
    *p_file = lw_file-FILENAME.
    Start-of-Selection.
    loop at it_tab INTO wa_tab.
       file_str1 = wa_tab-FILENAME.
    CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
         filename                      = file_str1
    *    filename                      = '\\10.10.1.92\Volume_1\_projekte\Zeiterfassung-SAP\test.azt'
       tables
         data_tab                      = it_string
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.

  • I am unable to synch music from selected playlists in my iTunes library onto my new iPod Classic, despite meticulously following the User Guide.

    I just purchased an iPod Classic, and after making sure I had the latest ver. of iTunes on my Intel MacMini, printed out the User Guide and carefully began learning how to operate the iPod. My first step was to ensure I had manual control (vs. auto synch) because I want only selected songs and playlists on the iPod, not my whole iTunes Library.
    On pg. 24 of the Guide is the topic "Synching music from selected playlists onto iPod Classic." Just what I wanted. OK, I selected iPod "in the source list" (aside: Shouldn't it be "in the device list?" I dispair of imprecision). This brought up the iPod Summary page, showing I had selected Open iTunes when connected and Manually manage music and videos. Next I clicked on the Music tab.
    This presented me with Synch Music next to an empty check box. Below it, and entirely grayed out was:
    Entire music library (showing a checked box)
    Selected Playlists, artists, albums and genres (next to an unchecked box).
    There's also a third grayed out item: Include music videos that is checked.
    When I selected Synch Music, I got the message: "Are you sure you want to removed existing mlusic, movies and TV shows from the iPod and synch with this iTunes LIbrary?   I selected Cancel because:
    1. The grayed option Entire Music Library is checked, not mly preferred option of Selected playlists, artists, albums and genres. .
    2. I can't find anywhere in the User Guide how to "Select the Playlists" I want to synch to my iPod. At present all I have in iTunes is my list of playlists in the left hand side bar.
    OK, my first thought was the checked box in the iPod's Summary window: Manually manage music and videos. So I went there and unchecked it, which immediately brought up an alert  to the effect "Are you sure you want to automatically synch your entire iTunes library, etc. etc...? I quickly cancelled. Thus, I seem to be in a Catch-22 situation. 
    So the questions are:
    How do I resolve the Synch Music issue so I am assured only selected playlists will be sent to my iPod?
    How do I create a list of playlists in my iTunes library to be transferred to my iPod?
    How do I manually move a playlist in my iTunes library to my iPod's lists of playlists?
    Any help much appreciated. Thanks to all.
    John in the Pacific Northwest

    For the immediately problem, you can shut down the computer and disconnect the iPod.
    There may be a process (program) running on your computer in the background that continuously monitors mounted volumes for things like maintenance, data corruption, and malware.  The iPod's storage is a mounted volume.  If you know of any such program, such as an "anti-virus" utility, and it has settings that allow you to exclude certain volumes, you can set it to ignore the iPod "disk" when connected.
    Also, if you are using automatic syncing (not the manual method) to load the iPod, and you have Enable disk use turned ON, turn it OFF.  With Enable disk use turned OFF, iTunes only mounts the iPods disk when syncing, then immediately unmounts the disk.  Thus, other processes you have running on your PC (not iTunes) will have less of a chance to make the disk "in use" and cause this problem.  You won't even have to eject the iPod before disconnecting.

  • I would select a link from the drop down on the address bar but the page would not open. I would select it again but the page does not open. I could only reach website by selecting google on most visited list.

    After updating AVG anti-virus, I encountered a problem on Firefox. I would select a link from the drop down on the address bar but the page would not open after clicking on it. I would select it again, even double click, but the page does not open. I could only reach website by selecting google or yahoo from my dropdown on the most visited list and then click the website that I want to visit. I would like to do this in one step by just selecting a link from my history on the address bar and select a link instead of going to google and then writing the page I want to visit. What could be the problem? When going to the address bar to select a link to open, why does the site not open? Any help would be appreciated.

    Hi,
    Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode.]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
    [http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars]

  • Get ID from selected row in data table

    Hi!
    Does someone know how to get ID from row on which I click a button or link?
    getRowData() doesnt work!
    Or any other method in jsp or just something to get the ID from selected row?
    Thanks!!!

    Hi,
    I have a table with 3 columns, where column 1 represents the key, column 2 represents the data and column 3 displays the "details"-button. If you use
    String key =(String)outputText1.getValue();
    the variable key contains the key value of the row of the column in which the "details"-button was clicked. (outputText1 is the Output Text field of the first column).
    Problem with this is that the key Value must be displayed in the table but maybe it works if the OutputText Field is not rendered, too. If anyone has another (maybe nicer) solution for the problem i would be pleased to see it here.

  • I can no longer select multiple addresses from my Mail address book when forwarding emails

    Since updating to Mavericks I cannot select multiple addresses from my address book when forwarding emails.
    I can select them individually using the + sign in the address bar but cannot select any when I open my Contact list as I have done with previous systems.
    Additionly, the full address appears in the "To" window instead of just the name and without the email address. I have selected "Smart Address" from the Preferences menu, View section.
    Help!

    Why are you using a Hotmail or Live Mail SMTP server to send email with your Gmail account?
    This is likely the cause of the problem. Use Gmail's authenticated SMTP server to send email with your Gmail account.

  • How do I select a item from a drop down list on a web in Safari On An. IPad 2.  The list apears and disapears só QuickClips I cannot TAP anything On The list Quickly enough.

    I tried to select an item from a drop down list on a web page in safari and discovered that the list disapeared to quickly for me to make a selection.  Has anyone else found this and solved the problem.  Many thanks.

    Demo wrote:
    I tried it on my iPad and I see what you mean. From what I can see when I go to the site on my Mac, it is Flash based and that will not work anyway.
    Actually, it is Javascript and uses the 'onmouseover' event.

Maybe you are looking for