Max vs. 10g feature

I would like to have records with the max lfdnr. Does anybody know a new 10g-feature instead of my statement?
SQL> with dummy as ( select 25 Nr#, 1  LfdNr, to_date('30.06.1982','dd.mm.yyyy') end_date from dual union all
  2                  select 25 Nr#, 2  LfdNr, to_date('30.06.1988','dd.mm.yyyy') end_date from dual union all
  3                  select 25 Nr#, 3  LfdNr, to_date('30.11.1997','dd.mm.yyyy') end_date from dual union all
  4                  select 25 Nr#, 4  LfdNr, to_date('31.12.2009','dd.mm.yyyy') end_date from dual union all
  5                  select 44 Nr#, 1  LfdNr, to_date('07.05.2002','dd.mm.yyyy') end_date from dual union all
  6                  select 44 Nr#, 2  LfdNr, to_date('01.08.2006','dd.mm.yyyy') end_date from dual union all
  7                  select 44 Nr#, 3  LfdNr, null end_date from dual union all
  8                  select 62 Nr#, 1  LfdNr, to_date('25.04.2006','dd.mm.yyyy') end_date from dual union all
  9                  select 62 Nr#, 2  LfdNr, to_date('11.07.2009','dd.mm.yyyy') end_date from dual union all
10                  select 11 Nr#, 1  LfdNr, to_date('07.05.2002','dd.mm.yyyy') end_date from dual union all
11                  select 11 Nr#, 2  LfdNr, to_date('01.08.2006','dd.mm.yyyy') end_date from dual union all
12                  select 11 Nr#, 3  LfdNr, to_date('21.09.2007','dd.mm.yyyy') end_date from dual)
13  select Nr#, LfdNr, end_date
14  from dummy
15  where lfdnr IN (select max(lfdnr) from dummy
16           group by nr#)
17  and end_date >= sysdate
18  group by nr#, LfdNr, end_date
19  /
       NR#      LFDNR END_DATE
        25          4 31.12.09
        62          2 11.07.09
SQL>

I doubt your current query logic. You query only the LFDNR in the subquery but I think you should also include the NR# like that:
with dummy as ( select 25 Nr#, 1  LfdNr, to_date('30.06.1982','dd.mm.yyyy') end_date from dual union all
                select 25 Nr#, 2  LfdNr, to_date('30.06.1988','dd.mm.yyyy') end_date from dual union all
                select 25 Nr#, 3  LfdNr, to_date('30.11.1997','dd.mm.yyyy') end_date from dual union all
                select 25 Nr#, 4  LfdNr, to_date('31.12.2009','dd.mm.yyyy') end_date from dual union all
                select 44 Nr#, 1  LfdNr, to_date('07.05.2002','dd.mm.yyyy') end_date from dual union all
                select 44 Nr#, 2  LfdNr, to_date('01.08.2006','dd.mm.yyyy') end_date from dual union all
                select 44 Nr#, 3  LfdNr, null end_date from dual union all
                select 62 Nr#, 1  LfdNr, to_date('25.04.2006','dd.mm.yyyy') end_date from dual union all
                select 62 Nr#, 2  LfdNr, to_date('11.07.2009','dd.mm.yyyy') end_date from dual union all
                select 11 Nr#, 1  LfdNr, to_date('07.05.2002','dd.mm.yyyy') end_date from dual union all
                select 11 Nr#, 2  LfdNr, to_date('01.08.2006','dd.mm.yyyy') end_date from dual union all
                select 11 Nr#, 3  LfdNr, to_date('21.09.2007','dd.mm.yyyy') end_date from dual)
select Nr#, LfdNr, end_date
from dummy
where (nr#,lfdnr) IN (select nr#, max(lfdnr) from dummy
         group by nr#)
and end_date >= sysdate ;If you want to get rid of the subquery you don't need a 10g feature as already shown. If you want to use analytic functions: These are already available in 9i:
with dummy as ( select 25 Nr#, 1  LfdNr, to_date('30.06.1982','dd.mm.yyyy') end_date from dual union all
                select 25 Nr#, 2  LfdNr, to_date('30.06.1988','dd.mm.yyyy') end_date from dual union all
                select 25 Nr#, 3  LfdNr, to_date('30.11.1997','dd.mm.yyyy') end_date from dual union all
                select 25 Nr#, 4  LfdNr, to_date('31.12.2009','dd.mm.yyyy') end_date from dual union all
                select 44 Nr#, 1  LfdNr, to_date('07.05.2002','dd.mm.yyyy') end_date from dual union all
                select 44 Nr#, 2  LfdNr, to_date('01.08.2006','dd.mm.yyyy') end_date from dual union all
                select 44 Nr#, 3  LfdNr, null end_date from dual union all
                select 62 Nr#, 1  LfdNr, to_date('25.04.2006','dd.mm.yyyy') end_date from dual union all
                select 62 Nr#, 2  LfdNr, to_date('11.07.2009','dd.mm.yyyy') end_date from dual union all
                select 11 Nr#, 1  LfdNr, to_date('07.05.2002','dd.mm.yyyy') end_date from dual union all
                select 11 Nr#, 2  LfdNr, to_date('01.08.2006','dd.mm.yyyy') end_date from dual union all
                select 11 Nr#, 3  LfdNr, to_date('21.09.2007','dd.mm.yyyy') end_date from dual)
,dummy2 as (
select nr#, lfdnr, end_date, row_number() over (partition by nr# order by lfdnr desc) as row_no
from dummy)
select Nr#, LfdNr, end_date
from dummy2
where row_no = 1
and end_date >= sysdate ;Regards,
Randolf
Oracle related stuff:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle:
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/

Similar Messages

  • Oracle 10g features

    Hi
    Please provide some information on Oracle 10g features.
    Thank you

    Hi,
    Are you looking for all features or new features??
    For all features (in case you're new to Oracle), I guess you need to go through the Oracle Documentation for Oracle 10g [http://download.oracle.com/docs/cd/B19306_01/index.htm]
    In case you're looking for new features, go to [http://download.oracle.com/docs/cd/B19306_01/server.102/b14214/toc.htm]
    Thanks,
    Ankur

  • Oracle 9i and oracle 10g features

    Looking for some info/link which could help me in understanding the newer features in oracle 9i database and in 10g dbase.
    Will be good to know the additional features which are in 10g release but not in 9i.

    Go to the documentation.
    Look for the book called 'New Features'. It's big, but it's only an overview.
    When you find new features of interest, go to the manual for that feature and look in the area between he table of contents and Chapter 1 - the area titled 'New Features' - for more explanation.
    Surprisingly, documentation can be useful - you get a lot less sarcasm and typos in the docco <g>

  • Any docs with new 10g features?

    Hey,
    Were currently evaluating OEM to use to monitor our environments but there are a couple of key features that our manager wants that our current homegrown system offers.
    1. Call escallation.. If a problem still exists after the Nth poll by OEM. Basically, if for some reason the prime on-call person doesn't respond to the page then at some point we want to escalate to a manager. We've had problems with pagers before where people were in some buildings for a few hours and come out to receive a flurry of pages.
    2. Keep paging... If there is a problem, then unless we blackout the database while were working on it, we want to keep getting paged.
    As far as I know 9i OEM doesn't do this.. Any features or workarounds in 10g? I've looked for documentation but haven't seen a complete features doc yet.
    Thanks!

    http://otn.oracle.com/tech/grid/index.html
    http://otn.oracle.com/products/database/oracle10g/index.html
    http://otn.oracle.com/tech/grid/DB10g.html
    http://otn.oracle.com/tech/grid/EM_GC10g.html
    Joel P�rez

  • Questions on OBPM 10g features

    Hi,
    Can OBPM 10g integrated with Oracle BRE?
    I want to define my business rules in Oracle BRE and access them from BPM 10g process. Please give me directions on how to achieve this? I know that in 10g there is an internal rules creation based on the project variables. But my requirement is to keep the business rules in the external Oracle BRE and access them from BPM 10g process.
    Thanks in advance

    If you're using Oracle Business Rules 11g then they are exposed as a web service that can be invoked by Oracle BPM 10 directly once the WSDL is introspected. If it's Oracle Business Rules 10, then you need to add a BPEL wrapper and then invoke the BPEL as a web service.
    Dan

  • Oracle Enterprise edition 10g features

    Hi Team,
    customer has a oracle 10g EE at primary. so mu questions related are
    - Do i require license for a remote standby Lic while replcating using oracle data guard
    - IS "RMAN" and oracle "enterprise manager" is free in DR Site if i purchase oracle EE at DR
    - can we run a DR without a license
    Rgds

    Hi;
    AFAIK you need extra license for Actice DG, for DG if you are on EE level you dont need to pay extra license.
    For best answer, As mention here for your issue log a SR or contact wiht your oracle local office sales person.
    PS:Please dont forget to change thread status to answered if it possible when u belive your thread has been answered, it pretend to lose time of other forums user while they are searching open question which is not answered,thanks for understanding
    Regard
    Helios

  • 10g Features

    Is there any detailed doco on what's coming in 10g, i've found a couple of links, but none answer my question.
    Has the allowable length of a table name been increased in 10g?

    On the OTN main page, if you click on "Oracle Database" in the left-hand navigation bar, you'll get links to, so far as I'm aware, all the publicly available 10g documentation Oracle has produced. There are a number of books slated to become available when 10g ships, and I assume that the Oracle manuals will ship at the same time).
    I've not heard anything about increasing the maximum length of a table name, but I'd wager that limit won't be increased any time soon. Very few people come close to 30 characters in their table names and most people prefer it that way. There are also a lot of scripts and a lot of code out there that assumes that table names are limited to 30 characters. Given the pain involved in modifying all that code, and the pain involved with asking DBA's to modify their own scripts, and comparing that to the possible benefits, I don't see that limit being lifted any time soon.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com/askDDBC

  • Using complete oracle 10g features....

    I do have the documentation but acccording to my personal experince this forum with gurus aroun here is better
    i wud like to noe how to make the best use of forms 10g like
    making good graphically appealing form,increased funcationality how to incude flash objects,
    n whats the use of using import java classes, import OLE interface and how to select the specific class or the package according to the requirements...i.e how to use and when to use them..!!!
    will it be easy to create webbased applications using Jdeveloper or will it b better to use forms....???

    my 5 cent:
    making good graphically appealing form,what does that mean?
    increased funcationality how to incude flash objectsthere is a java-bean that can be used as a "Web-Browser inside forms" that supports Flahs animations ( http://forms.pjc.bean.over-blog.com/article-5029633.html )
    n whats the use of using import java classes, Java-classes can be imported to enhance the functionality with logic written in java. The java-coe gets executed on the application-server. An example might be the logic to call a webservice.
    import OLE interface OLE is a windows-technique to somehow "remote-control" windows-applications or functionality provided in Active-X-dlls. OLE-calls work on the client (and in 10G require WEBUTIL)
    and how to select the specific class or the package according to the requirements...i.e how to use and when to use them..be more specific
    will it be easy to create webbased applications using Jdeveloper "42", or in other words, "it depends".
    It will be easy if you are capable of the nechnologies you need. JDeveloper is not a technology but a tool for java-development which supports the development of web-applications. But, there are a lot of web-technologies based on java which you can use. For more details you might read some stuff about JEE
    or will it b better to use forms....???Also, it depends. There are certain areas where Forms will be better (or easier, or more productive) to use. As forms requires a somehow "fat" client with the installation of the Java-Runtime and certain permissions for the applet to work properly, it may not be the first choice if you implement some public web-application. For "inhouse"-applications run on a companies intranet which deal with "alphanumerical data", forms may be the better choice because of a more Windows-like behaviour and/or its great productivity. (Both are just examples, you'll have to decide which technology to use based on certain reuqirements for a certain application)

  • What are the new 10g features that are heavily used by SAP products?

    Please help list them.  Because we think that we have not exploered 10g to what we should
    have explored.
    Thanks!

    Hi Christy,
    Please check below SAP notes & links.
    Note 828268 - Oracle Database 10g: New functions
    Note 1035137 - Oracle Database 10g: Automatic Undo Retention
    Note 1035051 - Transportable tablespaces
    Note 838725 - Oracle Database 10g: New database statistics
    Note 621293 Oracle 9i/10g: Real Application Clusters
    http://www.oracle.com/newsletters/sap/docs/ora4sap-db-of-choice.090213.pdf
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/9e/6f054c93408a49ad49bde77b012319/frameset.htm
    Hope this helps you.
    Thanks
    Sushil

  • 10g Feature Query/Request

    Is it possible to set the tab size to different amounts for different file types? For instance, I like my Java source code to have a relatively large indentation, as I believe this enhances readability. However, XML files tend to have much deeper nesting, and therefore a large tab size quickly results in having to scroll the document to the right to see the innermost content. Anything nested this deeply in source code is probably bad code and should be refactored, but this happens all the time in UIX, for example, since almost every tag needs an additional 'contents' tag.
    I can only find one global tab size setting in the 'Code Editor' properties. If there isn't currently any way to set this size differently for individual file types, please consider this feature for future releases.

    You can tell Apple your wishes directly using this link: http://www.apple.com/feedback/iphone.html

  • PL/SQL New Features for Oracle 10g

    Hi,
    If anybody asks what are the new features in PL/SQL for Oracle 10g version, what would be the answer?
    Thanks,
    Mrinmoy

    user3001930 wrote:
    Hi,
    If anybody asks what are the new features in PL/SQL for Oracle 10g version, what would be the answer?
    Thanks,
    MrinmoyI would say: Who cares about 10g features nowadays. And they I would tell them about the new 11g features (that I remember).

  • Migrating forms from 6i to forms 10g

    Hi all,
    We plan to migrate the current forms 6i to forms 10g. Can you please suggest/advise the advantages of forms 10g to that of forms 6i.
    thanks in advance
    Chettarjee

    Hi
    the one main big advantage is that you will have Oracle support in 10g. 6i is not supported any more. Other benefits are 10g is more open to Java . You can call out to Web service and java apis. REfer to the forms otn page for more 10g features.
    Rgds
    Arvind Balaraman

  • "In-Memory Database Cache" option for Oracle 10g Enterprise Edition

    Hi,
    In one of our applications, we are using TimesTen 5.1.24 and Oracle 9i
    databases (platform - Solaris 9i).
    TimesTen holds application information which needs to be accessed quickly
    and Oracle 9i is a master application database.
    Now we are looking at an option of migrating from Oracle 9i to Oracle 10g
    database. While exploring about Oracle 10g features, came to know about
    "In-Memory Database Cache" option for Oracle Enterprise Edition. This made
    me to think about using Oracle 10g Enterprise Edition with "In-Memory
    Database Cache" option for our application.
    Following are the advantages that I could visualize by adopting the
    above-mentioned approach:
    1. Data reconciliation between Oracle and TimesTen is not required (i.e.
    data can be maintained only in Oracle tables and for caching "In-Memory
    Database Cache" can be used)
    2. Data maintenance is easy and gives one view access to data
    I have following queries regarding the above-mentioned solution:
    1. What is the difference between "TimesTen In-Memory Database" and
    "In-Memory Database Cache" in terms of features and licensing model?
    2. Is "In-Memory Database Cache" option integrated with Oracle 10g
    installable or a separate installable (i.e. TimesTen installable with only
    cache feature)?
    3. Is "In-Memory Database Cache" option same as that of "TimesTen Cache
    Connect to Oracle" option in TimesTen In-Memory Database?
    4. After integrating "In-Memory Database Cache" option with Oracle 10g, data
    access will happen only through Oracle sqlplus or OCI calls. Am I right here
    in making this statement?
    5. Is it possible to cache the result set of a join query in "In-Memory
    Database Cache"?
    In "Options and Packs" chapter in Oracle documentation
    (http://download.oracle.com/docs/cd/B19306_01/license.102/b14199/options.htm
    #CIHJJBGA), I encountered the following statement:
    "For the purposes of licensing Oracle In-Memory Database Cache, only the
    processors on which the TimesTen In-Memory Database component of the
    In-Memory Database Cache software is installed and/or running are counted
    for the purpose of determining the number of licenses required."
    We have servers with the following configuration. Is there a way to get the
    count of processors on which the Cache software could be installed and/or
    running? Please assist.
    Production box with 12 core 2 duo processors (24 cores)
    Pre-production box with 8 core 2 duo processors (16 cores)
    Development and test box with 2 single chip processors
    Development and test box with 4 single chip processors
    Development and test box with 6 single chip processors
    Thanks & Regards,
    Vijay

    Hi Vijay,
    regarding your questions:
    1. What is the difference between "TimesTen In-Memory Database" and
    "In-Memory Database Cache" in terms of features and licensing model?
    ==> Product has just been renamed and integrated better with the Oracle database - Times-Ten == In-Memory-Cache-Database
    2. Is "In-Memory Database Cache" option integrated with Oracle 10g
    installable or a separate installable (i.e. TimesTen installable with only
    cache feature)?
    ==> Seperate Installation
    3. Is "In-Memory Database Cache" option same as that of "TimesTen Cache
    Connect to Oracle" option in TimesTen In-Memory Database?
    ==> Please have a look here: http://www.oracle.com/technology/products/timesten/quickstart/cc_qs_index.html
    This explains the differences.
    4. After integrating "In-Memory Database Cache" option with Oracle 10g, data
    access will happen only through Oracle sqlplus or OCI calls. Am I right here
    in making this statement?
    ==> Please see above mentioned papers
    5. Is it possible to cache the result set of a join query in "In-Memory
    Database Cache"?
    ==> Again ... ;-)
    Kind regards
    Mike

  • How to find out the features/available in a particular version

    Hi
    thanks in advance. I am a novice user. I am using oracle 8.1.7. How can I find out the commands/ features rellated to this version of SQL.

    Hi Devmiral
    Thanks for the links that are of great help. akadia.com is full of resources But I faced one problem as most of the analytical functions did not work on 8.1.7 like rank, dense_rank, running total etc etc
    I have a celeron laptop with 256 MB of RAM and installed oracle 8i database. working on sql is comfortable, but can I install SQL 9.0.1 or higher on this laptop and operate at the same speed.
    I do not want to install the whole of Oracle 9i or Oracle 10g, my objective is to practice all the 9i/10g features of SQL installing the minimum of SQL engine.
    Is it possible, if possible then do let me know the methods or procedure.
    Thanks

  • How can we improve the rebuid script in 10g

    Hi
    Plateform solaris = SunOS 5.9
    current database version is = 9.2.0.7
    Our client ir migrating database to oracle 10g. I don't have much knowledge on 10g
    for reorg of indexes I have been using following scripts in 9.2.0.7
    alter index GMOWNER.INDEX_34FG rebuild tablespace MAINIDX01_MEDIUM;
    please suggest if this script will work fine in 10g too. if not what change is required.
    is there any 10g feature which make index Rebuild process fast.
    Regards
    mahesh

    If you're rebuilding all the indexes at a time when the database is not doing anything, then you may as well carry on using the same command - it's probably not doing much harm and it might be doing a little good.
    If you need the rebuilds to go faster because you have a limited window when the database is idle, the best way to speed up the command is to stop doing it for all indexes except the ones you know are in need of house-keeping for some reason.
    If you're talking about just the odd handful of indexes that you can identify as problem indexes because of the nature of the application, you might check to see if [*the coalesce command*|http://jonathanlewis.wordpress.com/2008/09/26/index-analysis/] is more appropriate.
    As it stands, your rebuild command locks the underlying tables - you've seen one suggestion to use the ONLINE option, but that does more work because it has to scan the table whilst the older option MAY be able to scan the existing index to build the new copy (online also needs to lock the table briefly twice); you've also seen one suggestion to use a parallel build, but building several indexes concurrently may be more effective than using parallelism to build each in turn, there is no generic strategy that is the best in all circumstances.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for