Can we Filter the records using ROW_NUMBER() funtion?

Oracle 10G
Hi all,
In the below query i used ROW_NUMBER() function to get the rownum value after descending order the results.
How Can i filter the first 10 rows without using a subquery?
I tried to use alias names but it doesn't work. Is there a way or it should be done only with subqueries?
select article_type_id,
article_type_desc,
ROW_NUMBER() OVER ( order by article_type_id desc) rnum
from s_article_types
Results are
ARTICLE_TYPE_ID     ARTICLE_TYPE_DESC     RNUM
37     Non-Degree News     1
36     Career News     2
35     ET News     3
34     Hotcourses 2.0 General     4
33     Hotcourses 2.0 Permanent     5
32     Hotcourses 2.0 News     6
1 General news 37
Thanks in advance

You can do
select * from
  select article_type_id, 
  article_type_desc,
  ROW_NUMBER() OVER ( order by article_type_id desc) rnum
  from s_article_types
where rnum <= 10You can't do it direct.

Similar Messages

  • Garage Band,  I am using an MBOX with a digi design audio core as a mic interface to recod into Garage Band.  Now when I Change the preferences to use the MBOX I can not move the recorder slider and there is no sound going into garage band?  Any solutions

    Garage Band,  I am using an MBOX with a digi design audio core as a mic interface to recod into Garage Band.  Now when I Change the preferences to use the MBOX I can not move the recorder slider and there is no sound going into garage band?  Any solutions

    10.5.8 with latest garageband 5.1 with MBOX 1. On Nov 4.09 I did a software update, now i get no output volume or input volume to the computer itself. I get it from head phones from my mbox, but not to the computer. Before the software update It worked great. I've tried upgrading software through digidesign .com, but they dont seem to have one for what i need. any way to get my old garage band back? go from 5.1 to earlier? Or maybe it was the upgrade to 10.5.8. update? Can i go back in time lol?
    Any help would be appreciated
    BTW
    Ive tried all the system sound prefs, and garage band drivers. Back and forth.
    cheers
    ds

  • Can not filter the data with the extended class

    Hi,
    I have a quick question about PortableObject format. I have created a class which extends PortableObject interface and implemented serializer methods as well. I have updated it in the pof-config.xml file as well. If I insert the objects of this type of object in the cache, they get inserted properly and I can filter the values based on the getters defined in the class. Everything works fine here.
    Now, I am trying to extend the existing class that I have. We have our custom API which we have built for our domain objects. I need to store these objects in the cache. So, naturally I need to implement PortableObject interface to do that. So, instead of creating a new class with new set of getters and setters and local fields, I am extending our domain class to create a new class which implements PortableObject interface. Instead of defining the local fields and getters and setters i am reusing the ones provided by my existing class. Now, I can insert the objects of the new class to the cache. But I can not filter the values for the objects of this new class.
    Let me show you what exactly I am trying to achieve by giving a small example:
    Domain Class:
    class Person
    private String person_name;
    *public String getPerson_name() {return person_name;}*
    *public String setPerson_name(person_name) {this.person_name = person_name;}*
    The new class implementing PortableObject interface:
    class ExtPerson extends Person implements PortableObject
    public static final PERSON_NAME = 0;
    *public void readExternal(PofReader reader) throws IOException{*
    setPerson_name(reader.readString(PERSON_NAME));
    *public void writeExternal(PofWriter writer) throws IOException{*
    writer.writeString(PERSON_NAME, getPerson_name());
    *// And HashCode, Equals and ToString methods, all implemented using the getter from the Person class*
    So, if I create a new class ExtPerson without extending the Person class and write all the methods, store the objects in the cache and perform the following query, I get the size printed
    System.out.println((cache.entrySet(new EqualsFilter("getPerson_name","ABC"))).size());
    But if I use the extended class and insert the values into the cache and if I use the same query to filter, I get 0 printed on the console.
    System.out.println((cache.entrySet(new EqualsFilter("getPerson_name","ABC"))).size());
    So, can anyone tell what exactly is causing this?
    Thanks!

    Well, just a quick question. It seems that I can not get ContainsAnyFilter or ContainsAllFilter working.
    EqualsFilter is actually working properly.
    I am preparing a Set of Strings and passing it to ContainsAnyFilter or ContainsAllFilter and it is returning me 0 records.
    E.g.:
    Set<String> setStr = new HashSet<String>();
    setStr.add("ABC");
    setStr.add("DEF");
    System.out.println((cache2.entrySet(new ContainsAnyFilter("getPerson_name", setStr))).size());
    I get 0 in my output
    If I try this:
    System.out.println((cache.entrySet(new EqualsFilter("getPerson_name","ABC"))).size());
    System.out.println((cache.entrySet(new EqualsFilter("getPerson_name","DEF"))).size());
    I get 1 for each of the query.
    If I club all these EqualsFilter in a Filter[] array and create an AnyFilter or AllFilter and pass it to the query, it works fine.
    List<Object> lst = new ArrayList<Object>();
              lst.add("ABC");
              lst.add("DEF");
    Filter[] filter = new Filter[lst.size()];
         for(int i=0;i<lst.size();i++)
              filter[i] = new EqualsFilter("getPerson_name",lst.get(i).toString());
    AnyFilter fil = new AnyFilter(filter);
    System.out.println((cache4.entrySet(fil)).size());
    I get the desired result here, which is 2.
    Am I missing something here?

  • Why I can not unlock the record when close a page?

    I develop a jsp page as client,the jsp application use a business componment with statefull application module.i call a database rowset's lock function in jsp page to lock a record,now,after i close the jsp page without commit and rollback,the record is not unlocked,until i restart the oc4j application server.how can i unlock the record when close the page without commit and rollback?????

    Li Ping:
    If you lock a row in the course of a transaction, you cannot unlock the row until the end of transaction (either rollback or commit). DBMS doesn't allow this.
    Alternatively, you can try to delay locking of the row. E.g., you can try using optimistic locking. Please see the Java Doc for oracle.jbo.Transaction if you're interested in optimistic locking.
    Thanks.
    Sung

  • How can I Improve the Performance using Global Temo Tables ??

    Hi,
    Can anyone tell me , How can i make use of Global Temporary Tables to improve the Performance.
    I have few sample scripts ,
    Say i have the View based on some Complex query like ,
    CREATE OR REPLACE VIEW Profile_values_view AS
    SELECT d.Profile_option_name, d.Profile_option_id, Profile_option_value,
    u.User_name, Level_id, Level_code
    FROM Profile_definitions d, Profile_values v, Profile_users u
    WHERE d.Profile_option_id = v.Profile_option_id
    AND ((Level_code = 'USER' AND Level_id = U.User_id) OR
    (Level_code = 'DEPARTMENT' AND Level_id = U.Department_id) OR
    (Level_code = 'SITE'))
    AND NOT EXISTS (SELECT 1 FROM PROFILE_VALUES P
    WHERE P.PROFILE_OPTION_ID = V.PROFILE_OPTION_ID
    AND ((Level_code = 'USER' AND
    level_id = u.User_id) OR
    (Level_code = 'DEPARTMENT' AND
    level_id = u.Department_id) OR
    (Level_code = 'SITE'))
    AND INSTR('USERDEPARTMENTSITE', v.Level_code) >
    INSTR('USERDEPARTMENTSITE', p.Level_code));
    Now i have created the Global temp Table as ,
    CREATE GLOBAL TEMPORARY TABLE Profile_values_temp
    Profile_option_name VARCHAR(60) NOT NULL,
    Profile_option_id NUMBER(4) NOT NULL,
    Profile_option_value VARCHAR2(20) NOT NULL,
    Level_code VARCHAR2(10) ,
    Level_id NUMBER(4) ,
    CONSTRAINT Profile_values_temp_pk
    PRIMARY KEY (Profile_option_id)
    ) ON COMMIT PRESERVE ROWS ORGANIZATION INDEX;
    Now I am Inserting the Records into Temp table as
    INSERT INTO Profile_values_temp
    (Profile_option_name, Profile_option_id, Profile_option_value,
    Level_code, Level_id)
    SELECT Profile_option_name, Profile_option_id, Profile_option_value,
    Level_code, Level_id
    FROM Profile_values_view;
    COMMIT;
    Now what my doubt is, when do i need to execute the Insert Statement.
    Say , if the View returns few millions of records , then loading such a data into Global Temporary table takes lot of time.
    Then what is the use of Global Temporary tables and how can i improve the Performance using the same.
    Raj

    Thanks for the responce ,
    There are 2 to 3 complex views in our database, and there always be more than 5000+ users will be workinf on the application and is OLTP application. Those complex views are killing the application performance.
    I what i felt was, if i create the Global Temporary tables for thow views and will be able to load the one third million of records returned by the views in to cache and can improve the application performance.
    I have created the Global Temporary tables for 2 views with the option On Commit Preserve , But after am inserting the records into the Temp table and when i Issue the commit statement, the Temp table is getting Cleared.
    I really got surpised of this behaviour as i know that with the Option On Commit Preserve , the rows should retain in the Temp Table, Instead , it's getting cleared.
    Pelase suggest , what to do ??
    Raj

  • How can I filter thermocouple noise using a TC-2095 and SCXI-1102c?

    Hello all,
    I currently have four TC-2095s connected to SCXI-1102c cards inside a SCXI-1001 chassis. These thermocouples are floating and I have been getting a fair amount of noise (3-phase 400 Hz and even 60 Hz noise) when we power on some equipment such as blowers and fans. Using this current set up, how can I filter the noise? Or do would I need to set up a new hardware configuration (i.e. SCXI-1102 cards)?
    Solved!
    Go to Solution.

    Hi RALoo, 
    The 1102C has a lowpass filter with a cutoff at 10kHz, so you will not be able to filter in hardware with your current setup.  
    Your first option would be to use a software filter.  LabVIEW has several functions which accomplish this. More information on this can be found here: http://zone.ni.com/reference/en-XX/help/371361J-01/lvanls/filter_vis/
    The second option would be to change to SCXI 1102 cards as you suggested.  The lowpass filter of the 1102 has a selectable cutoff frequency at 2 Hz, which will stop the 400 and 60Hz noise from affecting your readings.
    Patrick W.
    Applications Engineer
    National Instruments

  • How can I change the value used in a Criteria Rule in a Subscription agent

    Dear mobile heroes.... How can I change the value used in a Criteria Rule in a Subscription agent in a quality environment? (CRM 70 SP04).
    I have built a subscription agent in dev, which uses a static where clause to filter activity_object on VKORG. I need to filter on a different VKORG value in the quality environment, but when I change the value of the sales org, the change is not saved. I have tried this even non 'activated'  subscription agents, but it still does not appear possible to change and save the changes.
    This poses a big problem because the VKORG value I want to use does not even exist in the dev environment, so I could not even rebuild in dev and transport the new agent to quality. Can anyone help me?

    Too old to care now.

  • Can we change the Record Group Type through Custom.pll

    Hello All,
    I have a small requirement on Changing the Record Group Dynamically.
    Can i set the Record group type to 'Query' from 'Static'. i.e Can i change the Record group type dynamically through custom.pll. I know that we can dynamically change the Record group query.
    Please help me its a bit urgent.
    Thanks inadvance,
    Amarnadh Js

    you can control your record group runtime without create any recordgroup at design time..
    1.static group
    declare
       rg_name         VARCHAR2 (40)  := 'Global_Rgp_Menu';     --global record group name for menu use
       rg_id           recordgroup;                                            --global record group id
       gc_id           groupcolumn;                                     --global record group coulmn id
       errcode         NUMBER;                                                             --error code
       grp_row         PLS_INTEGER    := 0;                             --global record group row count
    begin
      rg_id := FIND_GROUP (rg_name);
       IF NOT ID_NULL (rg_id)
       THEN
          DELETE_GROUP_ROW (rg_id, all_rows);
       ELSE
          rg_id := CREATE_GROUP (rg_name, global_scope);
          gc_id := ADD_GROUP_COLUMN (rg_id, 'menu_item', char_column, 100);
          gc_id := ADD_GROUP_COLUMN (rg_id, 'p_type', char_column, 100);
          gc_id := ADD_GROUP_COLUMN (rg_id, 'p_no', char_column, 100);    
       END IF;
      grp_row := 0;
      for 1 in 1..10 loop
           grp_row := grp_row + 1;
          ADD_GROUP_ROW (rg_id, grp_row);
          SET_GROUP_CHAR_CELL (rg_name || '.menu_item', grp_row, 'menu' || to_char(i) );
          /*type*/
          SET_GROUP_CHAR_CELL (rg_name || '.p_type', grp_row,  'type' || to_char(i) );
          /*program_no */
          SET_GROUP_CHAR_CELL (rg_name || '.p_no', grp_row,  'programno' || to_char(i) ); 
      end loop;
    end;
    2. query group
    declare
       FACT_SQL VARCHAR2(500) :=NULL;
       rg_name1       VARCHAR2(40) := 'Global_Rgp_fact';
       rg_id1   RecordGroup;
       Error_Flag number:=0;
       group_error exception;
    begin
       rg_id1 := Find_Group( rg_name1 ); IF NOT Id_Null(rg_id1) THEN Delete_Group( rg_id1 ); END IF;     
       FACT_SQL := ' SELECT *   FROM MYFACTORY  ' ;      
       rg_id1 := Create_Group_From_Query( rg_name1,FACT_SQL ,global_scope);
        Error_Flag := POPULATE_GROUP(rg_id1);
        IF Error_Flag <>0 THEN     
               error_msg:='Error while populating factory group';   
               raise group_error;
        END IF; 
    exception
      when group_error then
         message(error_msg);
        raise;
    end;Edited by: nolemlin on 2010/3/23 上午 7:50

  • Anyone solve the "you can't change the record's entity name" issue

    Been getting the following in my system.log.  I have noticed it was posted before but no replies on how to solve it.  Hoping to get some traction on the issue.
    This is on a Intel Duel Core running 10.8.4
    Thanks,
    Ron
    Aug 24 11:35:48 enterprise iCalExternalSync[6112]: [0x7ff3f8c0e4e0] |Miscellaneous|Error| SyncServices precondition failure in [ISyncConcreteSession pushChangesFromRecord:withIdentifier:]: you can't change the record's entity name from com.apple.calendars.DisplayAlarm to com.apple.calendars.AudioAlarm in {
                  "com.apple.ical.sound" = Basso;
                  "com.apple.syncservices.RecordEntityName" = "com.apple.calendars.AudioAlarm";
                  owner =     (
                      "Event/p76"
                  sound = Basso;
                  triggerduration = "-54000";
    Aug 24 11:35:48 enterprise iCalExternalSync[6112]: [ICalExternalSync ]Encountered exception: [ISyncConcreteSession pushChangesFromRecord:withIdentifier:]: you can't change the record's entity name from com.apple.calendars.DisplayAlarm to com.apple.calendars.AudioAlarm in {
                  "com.apple.ical.sound" = Basso;
                  "com.apple.syncservices.RecordEntityName" = "com.apple.calendars.AudioAlarm";
                  owner =     (
                      "Event/p76"
                  sound = Basso;
                  triggerduration = "-54000";
              } withStack: (
                        0   iCalExternalSync                    0x000000010afd0a60 iCalExternalSync + 125536
                        1   iCalExternalSync                    0x000000010afbfac9 iCalExternalSync + 56009
                        2   iCalExternalSync                    0x000000010afcf694 iCalExternalSync + 120468
                        3   libdyld.dylib                       0x00007fff8a46d7e1 start + 0
                        4   ???                                 0x0000000000000007 0x0 + 7
    Aug 24 11:35:48 enterprise iCalExternalSync[6112]: [ICalExternalSync ]NSException name:ISyncInvalidArgumentsException reason:[ISyncConcreteSession pushChangesFromRecord:withIdentifier:]: you can't change the record's entity name from com.apple.calendars.DisplayAlarm to com.apple.calendars.AudioAlarm in {
                  "com.apple.ical.sound" = Basso;
                  "com.apple.syncservices.RecordEntityName" = "com.apple.calendars.AudioAlarm";
                  owner =     (
                      "Event/p76"
                  sound = Basso;
                  triggerduration = "-54000";
    Aug 24 11:35:48 enterprise SyncServer[6084]: [0x7fa1b940be70] |Server|Warning| lost connection 0x7fa1ba226f40 to com.apple.iCal

    The same I guess as if your work won't let you do anything - not a lot
    I would hold fire at the moment as I think its too early to be changing router security - I have no inside information but like many I suspect its a combination of firmware updates to routers and a patch needed on the iPad. If solely the latter then it will be fine for you, but if for example, the work routers are using Cisco Clean Connect, then there will be little you can do - it will be up to work I'm afraid.

  • How can we lock the table?? how can we lock the record

    Hi
    how can we lock the complete table?? how can we lock the record ?/
    Thanks
    Rama

    Lock objects are used to lock the database table while making the modifications on the database table.
    you can create your own lock objects using SE11.
    if you create lock objects on any table system will create two function modules.
    1.ENQUEUE....
    2.DEQUEUE.....
    first one is used to lock the table
    second one used to removing lock on the table.
    lock Table
    CALL FUNCTION 'ENQUEUE_E_TABLE'
    EXPORTING
    tabname = table_name
    EXCEPTIONS
    foreign_lock = 1
    system_failure = 2
    OTHERS = 3.
    Unlock Table
    CALL FUNCTION 'DEQUEUE_E_TABLE'
    EXPORTING
    tabname = table_name
    check this link :
    http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    _SCOPE = 1: The lock is not sent to the update program. The lock is removed when the transaction is ended.
    _SCOPE = 2: The lock is sent to the update program. The update program is responsible for removing the lock. The dialog program which requested the lock no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
    _SCOPE = 3: The lock
    Re: lock objects
    Reward if this helps.

  • How to find the records using contains with the word like this 'some text-some text'?

    Hi,
    How to find the records using the full text contains keyword and that column contains ‘some text-some text’
    In the above some text can be anything.
    Does anybody know please let me know.
    Thanks,

    Hello,
    You can try to create a Full Text Index on the table and use CONTAINS() to get the record which contains the specify words.
    For example:
    SELECT * FROM TABLE WHERE CONTAINS(column_name, 'some text')
    Reference:
    Full-Text Search (SQL Server)
    Creating Full Text Catalog and Full Text Search
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • I have just dowloaded the icloud control panel on my PC and i am am able to see everything that has been pushed to icloud from my ipad. However i cannot see my email. i can send from the computer using icloud, but i do not see any mail that is being rec.

    i have just dowloaded the icloud control panel on my PC and i am am able to see everything that has been pushed to icloud from my ipad. However i cannot see my email. i can send from the computer using icloud, but i do not see any mail that is being received by my ipad, which is set up with my mail server. What haven't i checked lol?

    turn your ipad off by holding the sleep wake button for 5 seconds and slide to turn off then turn it back on and the apps should be finished and if the apps didnt finish just redownload them

  • I keep getting "Unable to connect" for my firefox. It was working yesterday and I turned my computer off. I can get to the web using internet explorer 9. I don't know why my firefox is not working. Everything else is working. HELP....

    I keep getting "Unable to connect" for my firefox. It was working yesterday and I turned my computer off. I can get to the web using internet explorer 9. I don't know why my firefox is not working. Everything else is working.

    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.com/kb/Server+not+found
    *https://support.mozilla.com/kb/Firewalls

  • Can I change the colors used in iOS7?

    Can I change the colors used in iOS7?
    The white background makes reading text and numbers very difficult.  Especially if the are in light gray.

    The answer to your question is "No"...and what you're experiencing is a major gripe with this "Upgrade".
    If Apple would allow the Invert Colors option to be activated without the effect that has on images it would resolve most of the concerns about iOS 7.  I would even consider downloading it... again.

  • Can I sort the images used in a book's browser by the # of times used?

    I'm also producing a DVDSP slideshow of the event's (selected) photos not included in the book.
    Q2: Can I sort the images used in a book's browser by the # of times used?
    That way I don't have to search thru hundreds of photos. When used in a book, each photo gets a badge showing the # of times used. Can this badge be used in a sort?
    Or must I apply a keyword to the used (or unused) photos?
    Thanks.

    But if the file has been embedded, the file name is lost.

Maybe you are looking for