Use Min function in subquery

List the names names (first and last) of customers who have ordered the item with the lowest prouct price
Select CustFirstName, CustLastName
From Customer
Where (O.ProdNo= L.ProdNo*ProdNo) from SELECT MIN(ProdPrice) AS LowestPrice FROM Product;
When I run this it says SQL command not properly ended
I have four tables Orders, OrderLine, Product, Customer but I can't join product table with Orders table because product table hasn't got a foreign key
Is the where statement wrong?
Thanks

Please consider the following when you post a question.
1. New features keep coming in every oracle version so please provide Your Oracle DB Version to get the best possible answer.
You can use the following query and do a copy past of the output.
select * from v$version2. This forum has a very good Search Feature. Please use that before posting your question. Because for most of the questions
that are asked the answer is already there.
3. We dont know your DB structure or How your Data is. So you need to let us know. The best way would be to give some sample data like this.
I have the following table called sales
with sales
as
      select 1 sales_id, 1 prod_id, 1001 inv_num, 120 qty from dual
      union all
      select 2 sales_id, 1 prod_id, 1002 inv_num, 25 qty from dual
select *
  from sales4. Rather than telling what you want in words its more easier when you give your expected output.
For example in the above sales table, I want to know the total quantity and number of invoice for each product.
The output should look like this
Prod_id   sum_qty   count_inv
1         145       25. When ever you get an error message post the entire error message. With the Error Number, The message and the Line number.
6. Next thing is a very important thing to remember. Please post only well formatted code. Unformatted code is very hard to read.
Your code format gets lost when you post it in the Oracle Forum. So in order to preserve it you need to
use the {noformat}{noformat} tags.
The usage of the tag is like this.
{noformat}<place your code here>
{noformat}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to use Min function to get FileName into a Variable

    I was wondering how to use MIN function in Evaluate variable in package to get the first file name from the list(Datastore)
    With reference to Merging Flat Files into a single file Post number-4
    Thanx

    Hi Diwakar,
    That List data store should be table, than only it will gives the min of the filename string,
    If it is a file datastore, Min function does not works properly it will returns a first name in the file data store.
    so please, use an interface to upload the List filedatastore into some other temp table. From that table you can use variable to get Min value of file name.
    Thanks
    Madha

  • SQL statement using result of aggregate min function to fetch a row - how?

    Need help trying to get to something seemingly simple. I'll provide a simple example to illustrate the problem.
    I'll be using a simple addresses table with 4 fields.
    Create the table:
      CREATE TABLE "ADDRESSES"
       (     "OWNER_NAME" VARCHAR2(20 BYTE),
         "STREET_NAME" VARCHAR2(20 BYTE),
         "STREET_NUMBER" NUMBER
       ) ;populate with 6 rows
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('FRED','MAIN',1);
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('JOAN','MAIN',2);
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('JEAN','MAIN',3);
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('JACK','ELM',1);
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('JANE','ELM',2);
    Insert into ADDRESSES (OWNER_NAME,STREET_NAME,STREET_NUMBER) values ('JEFF','ELM',3);We now have this:
    Select * from addresses
    OWNER_NAME           STREET_NAME          STREET_NUMBER         
    FRED                 MAIN                 1                     
    JOAN                 MAIN                 2                     
    JEAN                 MAIN                 3                     
    JACK                 ELM                  1                     
    JANE                 ELM                  2                     
    JEFF                 ELM                  3                     
    6 rows selectedNow i wish to group by StreetName, and get a count of houses. At the same time, i'd like to know the first and last house number
        select
        street_name,
        count(*) "NBR HOUSES",
        min(street_number) "First Number",
        max(street_number) "Last Number"
         from addresses
        group by street_name
    produces
    STREET_NAME          NBR HOUSES             First Number           Last Number           
    ELM                  3                      1                      3                     
    MAIN                 3                      1                      3                     
    2 rows selectedExcellent. Now for the problem. I wish to also list on each line, the owner that lives at the first and/or last house number. Note again, assume that house number and street name is unique
    It would seem i have all that i need. Not sure how to get at it.
    I tried:
    select
        street_name,
        count(*) "NBR HOUSES",
        min(street_number) "First Number",
        max(street_number) "Last Number",
        (Select b.owner_name from addresses b where b.street_number = min(street_number) and b.owner_name = owner_name) "First Owner"
         from addresses
        group by street_nameBut get a sql syntax error, group function not allowed when i add the subselect.
    any ideas?
    thanks for any help.
    Edited by: user6876601 on Nov 19, 2009 7:08 PM
    Edited by: user6876601 on Nov 19, 2009 7:30 PM

    Hi,
    Welcome to the forum!
    Getting the highest and lowest number for each street is a fairly simple concept; simpler to describe, and simple to code.
    Now you want the owner_name associated with the highest and lowest number, which is a more complicated concept; a little harder to describe, and, unfortunately, much less simple to code, and much, much harder to explain:
    select
        street_name,
        count (*)                "NBR HOUSES",
        min (street_number)      "First Number",
        min (owner_name) KEEP (DENSE_RANK FIRST ORDER BY street_number)
                        "First Owner",
        max (street_number)      "Last Number",
        min (owner_name) KEEP (DENSE_RANK LAST ORDER BY street_number)
                        "Last Owner"
         from addresses
        group by street_name
    ;Notice that I used min for both "First Owner" and "Last Owner". Why is that?
    The important keyword in these funtions is the word FIRST or LAST that comes after DENSE_RANK and before ORDER BY. The function at the beginning is merely a tie-breaker.
    That is, MIN in this context only refers to what should happen when there is a tie for the first or last in the group. Even if such a thing is impossibe in your data, the generic functions have to have some mechanism for returning a single owner_name when two or more rows have an equal claim to having the highest street_number. For example, if we change Joan's address to 1 Main, then MIN (street_number) is still 1, obviously, but who is the person associated with the minimum street_number: is it Fred or Joan? Both have an equal claim to being the owner with the lowest address on Main Street, but aggregate functions must return a single value, so we have to have some mechanism for tell the system whether to return 'JOAN' or 'FRED'. In this example, I arbitrarily said that in the een of a tie, the lowest name, in alphabetic order, should be returned. In this case, 'FRED' would be returned, since 'FRED' is earlier than 'JOAN' .
    Thanks for including the CREATE TABLE and INSERT statements!

  • Using sql functions (min, max, avg) on varray or table collection

    Hi,
    I would like to know if there is a way to use sql function or oracle sql function like Min,Max, Avg or percentile_cont on varray or table collection ?
    Does anyone encountered this type of problem ?
    Thanks

    Yes you can apply Min,Max, Avg... if varray or table collection type is SQL (created in the databaase) UDF, not PL/SQL declared type:
    SQL> set serveroutput on
    SQL> declare
      2      type str_tbl_type is table of varchar2(4000);
      3      str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
      4      max_val varchar2(4000);
      5  begin
      6      select max(column_value)
      7        into max_val
      8        from table(str_tbl);
      9      dbms_output.put_line('Max value is "' || max_val || '"');
    10  end;
    11  /
          from table(str_tbl);
    ERROR at line 8:
    ORA-06550: line 8, column 18:
    PLS-00642: local collection types not allowed in SQL statements
    ORA-06550: line 8, column 12:
    PL/SQL: ORA-22905: cannot access rows from a non-nested table item
    ORA-06550: line 6, column 5:
    PL/SQL: SQL Statement ignored
    SQL> create or replace type str_tbl_type is table of varchar2(4000);
      2  /
    Type created.
    SQL> declare
      2      str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
      3      max_val varchar2(4000);
      4  begin
      5      select max(column_value)
      6        into max_val
      7        from table(str_tbl);
      8      dbms_output.put_line('Max value is "' || max_val || '"');
      9  end;
    10  /
    Max value is "ZZZ"
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Subquery removal using window functions

    Hi,
    DB is 9.2.0.8 EE .
    select * from FROM bt_osoby osoby , bt_osoby_firmy osf1
    WHERE osoby.osb_audyt_st = '1'
      AND osf1.osf_audyt_st = '1'
      AND osoby.osb_id = osf1.osf_osb_id
      AND osoby.osb_nzm_id != 4140963  
      AND osoby.osb_id = ( SELECT MAX (osoby2.osb_id)
                             FROM bt_osoby osoby2
                             WHERE osoby2.osb_audyt_st = '1'
                             AND osoby2.osb_nzm_id = osoby.osb_nzm_id) I'm trying to rewrite above with subquery removal using window functions trick.
    select * from bt_osoby osoby , (
      SELECT first_value(osoby2.osb_id) over (partition by osoby2.osb_nzm_id order by osoby2.osb_id desc nulls last) max_osb_id ,osoby2.osb_nzm_id o2_osb_nzm_id
                             FROM bt_osoby osoby2
                             WHERE osoby2.osb_audyt_st = '1') v
                             ,bt_osoby_firmy osf1
                             where
                             osoby.osb_audyt_st = '1'
      AND osf1.osf_audyt_st = '1'
      AND osoby.osb_id = osf1.osf_osb_id
      AND osoby.osb_nzm_id != 4140963
      AND   v.max_osb_id = osoby.osb_id
      AND osoby.osb_nzm_id = v.o2_osb_nzm_idbut rewritten query plan involves huge FTS on BT_OSOBY (much worst then NL over sub query before), how to
    benefit from 'subquery removal using window functions' then?
    Regards.
    GG

    Hi,
    As you discovered, a query with a sub-query can be more efficient that one without a sub-query.
    I would do this using the analytic RANK function (or, depending on your needes, maybe ROW_NUMBER).
    WITH     bt_osoby_with_rnum     AS
         select  bt_osoby.*
         ,     RANK () OVER ( PARTITION BY  osb_nzm_id
                               ORDER BY          osb_id     DESC
                        ) AS rnum
         FROM      bt_osoby
         WHERE     osb_audyt_st     = '1'
         AND     osb_nzm_id      != 4140963  
    SELECT     *     -- or list all columns except rnum
    FROM     bt_osoby_wtih_rnum             osoby
    ,      bt_osoby_firmy                 osf1
    WHERE      osf1.osf_audyt_st  = '1'
    AND      osoby.osb_id = osf1.osf_osb_id
    ;Of course, without versions of your tables, I can't test this.
    Note that this does use a sub-query.

  • How to use group function in insert or update

    Hai All
    How can we use group function in insert or update statement
    I am generating an attendance so i have different set of timing for example
    0800,1200,1230, 1700 and i need to insert into these data into table with min value to intime and max value to
    outtime and othere to inertval time in or out
    Pls tell me with some example
    For example
    For INSERT
    insert into T2 (barcode,empcode,intime,attend_date)
                   values(r2.cardn,r2.enpno,MIN(r2.ptime),r2.pdate);
    For UPDATE
    update dail_att set outtime= MAX(r2.ptime) where empcode=r2.enpno and barcode=r2.cardn and
    attend_date=r2.pdate;
    Here instead of where i need to use having so pls tell how to use
    Thanks & Regards
    Srikkanth.M

    Hai Man
    R2 is not a table name its a record
    Let me explain clearly
    I have to generate daily attendance for lot of employees So i have two table t1 and t2
    T1 consist of three column empno,date,time
    T2 consist of empno,name,date,intime,outtime,intrin,introut
    So now i need to give the T1 Min value Of time to T2 Intime and T1 Max value of Time to T2 Outtime fields so there so many records while i am using
    max(time) it gives the max value of all so i seperated by group function so now i have an error in subquery ie it is an single row subquery so i need to use multiple row subquery how i can use multiple row subquery in update statement
    Thanks In Advance
    Srikkanth.M

  • Should I set up separate apple ids for my kids or should we use mine?  If we separate them, can we still share our music from itunes?

    I have an iphone 5s and an ipad that both use my apple id.  Last week, my 2 kids got iphones so they are also using my id.  Should we create separate apple/icloud ids for them or should we all use mine?  Can we continue to share music from itunes if we have separate ones?  I'm really not sure of the best way to handle this and I don't want to screw anything up!  I really appreciate any help!  Thanks so much!

    There can be more than one Apple IDs for one iPhone, and each ID will be responsible for its own functions. You could, for example, set up one for iCloud, which will contain your contacts, calendars, settings, your backups, etc. But at the same time you could have another Apple ID for purchasing your apps, so when you buy or get free app, App Store will ask you for Apple ID and you can enter another ID that is not the same that keeps your backups and settings.
    If you want to separate your sons iPhone from your ID completely, you can change it in iCloud settings. Also it will make your children's life a lot easier.

  • Error while using group function

    Oracle forms6i
    Hai
    While i am compile my coding it compile successfully, but when i tried to executes i shows error in group function
    my coding is
    if (cnt<>0 ) then
    select BARCODE,INTIME,OUTTIME into today_bar,today_in,today_out from dail_att where BARCODE= :Barcode
    and ATTEND_DATE = :bardate;
    update dail_att set outtime = max(:bartime) where barcode= :barcode
    and ATTEND_DATE = :bardate;
    else
    if (cnt2<>0 ) then
    select INTIME,OUTTIME into yest_in,yest_out from dail_att where BARCODE= :Barcode
    and ATTEND_DATE = :bardate-1;
    if(yest_in is not null and yest_out is null) then
    update dail_att set outtime =max(:bartime) where barcode= :barcode
    and ATTEND_DATE = :bardate-1;
    else
    insert into dail_att(barcode,intime,attend_date)
    values(:barcode,min(:bartime),:bardate);
    end if;
    else
    if :bartime between 0100 and 0630 then
    insert into dail_att(barcode,intime,attend_date)
    values(:barcode,min(:bartime),:bardate-1);
    update dail_att set outtime = max(:bartime) where barcode= :barcode
    and ATTEND_DATE = :bardate-1;
    else
    insert into dail_att(barcode,intime,attend_date)
    values(:barcode,:min(bartime),:bardate);
    end if;     
    end if;
    end if;
    while i am trying to this groupfunction it throws error while i use having tell me how to use group function and where
    to use
    Regadrs
    Srikkanth.M

    Hai sir
    I had a table that contain fields
    EMPCODE NUMBER
    EMPNAME VARCHAR2(25)
    BARCODE VARCHAR2(25)
    INTIME VARCHAR2(25)
    OUTTIME VARCHAR2(25)
    INTRTIMEIN VARCHAR2(25)
    INTROUTTIME VARCHAR2(25)
    PERTIMEIN VARCHAR2(25);
    PERTIMEOUT VARCHAR2(25);
    ATTEND_DATE DATE ;
    Consider that a table with 6 fields ie timein,intrtimein,pertimein,pertimeout,intrtimeout,timeout
    I have generating a attendance table and a table contain 6 various times for an employees and we need to arrange it in order
    0815,0816,1230,1250,1645,1646
    If 0815 is the starting time then timein ie mintime
    0816 stored to be in intrtime
    then1250 then it stored in pertimein
    then 1230 then it stored in pertimeout
    then 1645 stored in intrtimeout
    then 1646 stored in timeout
    I tried with max and min function but its not working properly pls tell me some solutions
    Thanks & Regards
    Srikkanth.M

  • How to use analytical functions inside a mapping

    Hello everybody. Here Isend you a trick that we are using for two years.
    If you want to use a function (for instance :ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ...)) inside a mapping you must create an expression with in the INGRP1 the fields you are going to use in the window function and in the OUTGRP1 the function you want. Create an Out -attribute with the expressión and link it to a distinct operator (using a "distinct" you encapsulte the sql and you will be able to use the function inside a filter - in the where clause.). The distinct can eliminate some register (depends on the function). If you validate the expression an error will appear (don't worry about that, the mapping will be ok).
    But there is a limitation, you will not be able tou sum over, min over, max over (it detect that they are aggregator functions). Other limitation: the debugger doesn't run with this kind of functions.
    Please publish this information on "The Warehouse Builder Utility Exchange". Mi email is [email protected] (if you need more information)

    It is possible to add SUM, MIN, MAX functions also to OWB releases prior to Paris - You have to put them in double quotes - write "MIN" "MAX" "SUM" etc. The rest of the rules (adding cut-off operator after the expression - as DISTINCT, or UNION ALL) is analogical to with ROW_NUMBER()
    That means You can create mapping with following functionality:
    SELECT
    sum (salary) over (partition by DEPARTMENT) department_salary,
    salary,
    employee_id,
    employee_name
    FROM employees_salaries
    writing it this way in OWB:
    SELECT
    "SUM" (salary) over (partition by DEPARTMENT) department_salary,
    salary,
    employee_id,
    employee_name
    FROM employees_salaries
    Regards,
    Martin

  • Using Partner Functions to set up Person Responsible?

    Hello All,
    Can someone please advise what the best practice is for creating individual personnel entires for engineers within Plant Maintenance.
    In the past we have used work centres to identify individuals. This is causing issues with capacity planning and so I want to use an alternative method.
    I can see that Personnel No's can be created, however, this appears to require the use of the SAP HR module where the master data for these records are held, unfortunately we do not use SAP HR and so cannot use this here.
    Can I use Partner Functions to resolve this issue and if so how do I set it up?
    Essentially I want to create Work Centres for specific skill sets i.e Electician, Mechanic etc and then assign individuals to the appropriate groups. That way we can plan and record time against individual engineers.
    As always any help is appreaciated.
    Regards
    Chris
    Edited by: CGADMIN23 on Mar 30, 2011 2:18 PM

    Pete / Narasimhan
    Thankyou for your replys.
    I have not come across Mini HR Master previously so don't know how this works. We do not have the HR module installed and therefore I didn't think this would be a option.
    We have always set up individuals as Work Centres but having read through the 'Plant Maintenance with SAP' book I am lead to believe this is not best practice?
    Ultimately we would like to be able identify individuals so that we can assign jobs and plan capacity.  We also want to be able to assign individuals to specific work centres which would identify there particular skill set.
    Do we need to purchase an additional module to use HR Mini Master? How does this work?
    Regards
    Chris

  • Use of function

    I have a table with this records:
    linknumber history
    110 46,57,89
    220
    50
    330 22
    440 10,12
    I want to have this result:
    rownumber linknumber
    history
    1 110 46
    2 110 57
    3 110 89
    4 220 50
    5 330 22
    6 440
    10
    7 440 12
    and I have this function for split(camma):
    ALTER FUNCTION
    [dbo].[Split](@String varchar(8000), @Delimiter char(1))
    returns @temptable
    TABLE (items varchar(8000))
    as
    begin
    declare @idx int
    declare
    @slice varchar(8000)
    select @idx = 1
    if len(@String)<1 or @String
    is null return
    while @idx!= 0
    begin
    set @idx =
    charindex(@Delimiter,@String)
    if @idx!=0
    set @slice = left(@String,@idx
    - 1)
    else
    set @slice = @String
    if(len(@slice)>0)
    insert
    into @temptable(Items) values(@slice)
    set @String =
    right(@String,len(@String) - @idx)
    if len(@String) = 0 break
    end
    return
    end
    but I don,t know how to use this function in T-sql for
    my favorir result?plaese guide me how do I do this?thanks

    >> I have a table with this records [sic]: <<
    Rows are not records; this is a basic concept in RDBMS. Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming
    conventions and formatting rules. Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    The term “link” is not RDBMS, either. It comes from pointer chains and linked lists. RDBMS has no pointers or lists! It looks like you have no idea what you are doing. 
    Non-RDBMS programmers violate 1NF and write those absurd string splitters. In fact, you did not do a good job of writing bad code. You posted a BASIC or FORTRAN program written with 1970's T-SQL. You even used != instead of SQL's <> !  
    Passing a list of parameters to a stored procedure can be done by putting them into a string with a separator. I like to use the traditional comma. Let's assume that you have a whole table full of such parameter lists:
    CREATE TABLE InputStrings
    (keycol CHAR(10) NOT NULL PRIMARY KEY,
     input_string VARCHAR(255) NOT NULL);
    INSERT INTO InputStrings 
    VALUES ('first', '12,34,567,896'), 
     ('second', '312,534,997,896'),
     etc.
    This will be the table that gets the outputs, in the form of the original key column and one parameter per row.
    It makes life easier if the lists in the input strings start and end with a comma. You will need a table of sequential numbers -- a standard SQL programming trick, Now, the query, 
    CREATE VIEW ParmList (keycol, place, parm)
    AS
    SELECT keycol, 
           COUNT(S2.seq), -- reverse order
           CAST (SUBSTRING (I1.input_string
                            FROM S1.seq 
                             FOR MIN(S2.seq) - S1.seq -1) 
             AS INTEGER)
      FROM InputStrings AS I1, Series AS S1, Series AS S2 
     WHERE SUBSTRING (',' + I1.input_string + ',', S1.seq, 1) = ','
       AND SUBSTRING (',' + I1.input_string + ',', S2.seq, 1) = ','
       AND S1.seq < S2.seq
     GROUP BY I1.keycol, I1.input_string, S1.seq;
    The S1 and S2 copies of Series are used to locate bracketing pairs of commas, and the entire set of substrings located between them is extracted and cast as integers in one non-procedural step. The trick is to be sure that the right hand comma of the bracketing
    pair is the closest one to the first comma. The relative position of each element in the list is given by the value of "place", but it does a count down so you can plan horizontal placement in columns. 
    This might be faster now:
    WITH Commas(keycol, comma_seq, comma_place)
    AS
    (SELECT I1.keycol, S1.seq,
    ROW_NUMBER() OVER (PARTITION BY I1.keycol ORDER BY S1.seq)
    FROM InputStrings AS I1, Series AS S1
    WHERE SUBSTRING (',' + I1.input_string + ',' 
    FROM S1.seq 
    FOR 1) = ',' 
    AND S1.seq <= CHARLENGTH (I1.input_string))
    SELECT SUBSTRING(',' + I1.input_string + ','
    FROM C1.comma_place +1
    FOR C2.comma_place - C1.comma_place - 1)
    FROM Commas AS C1, Commas AS C2
    WHERE C2.comma_seq = C1.comma_seq + 1 
    AND C1.keycol = C2.keycol;
    The idea is to get all the positions of the commas in the CTE and then use (n, n+1) pairs of positions to locate substrings. The hope is that the ROW_NUMBER() is faster than the GROUP BY in the first attempt. Since it is materialized before the body of the
    query (in theory), there are opportunities for parallelism indexing and other things to speed up the works. 
    Hey, I can write kludges with the best of them, but I don't. You need to at the very least write a routine to clean out blanks, handle double commas and non-numerics in the strings, take care of floating point and decimal notation, etc. Basically, you must
    write part of a compiler in SQL. Yeeeech!  Or decide that you do not want to have data integrity, which is what most Newbies do in practice altho they do not know it. 
    >> but I do not know how to use this function in T-SQL for my favored result?  Please guide me how do I do this? <<
    Stop programming until you learn SQL. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • How to use a function in a Where Clause?

    Hi,
    I've got a doubt. If MY_FUNCT is a function that returns a boolean, can I use it in a where clause for writing a query like this?:
    select ...
    from table a
    where ...
    and MY_FUNC (a.field) = true
    Thanks!
    Edited by: Mark1970 on 2-lug-2010 3.27

    Bear in mind that this could kill your performance.
    Depending on what you're doing, how many tables and other predicates are involved, you might want to try to eliminate all other data early before applying your function predicate otherwise your function might be called more times than you might have imagined. Strategies for this include subquery factoring and the old ROWNUM trick for materialising an inline view.
    If performance is impacted, you might also want to consider using a function-based index provided that the function is deterministic.

  • How to use aggregate function with Date

    Hi All,
    I have a group of date from that is it possible to Max and Min of date.
    I have tried like this but its errored out <?MIN (current-group()/CREATION_DATE)?>.
    I have also tried like this but it doesnt works
    <?xdoxslt:minimum(CREATION_DATE)?>
    Is it possible to use aggregate function with date values.
    Thanks & Regards
    Srikkanth

    Hi KAVI PRIYA,
    if date is not in cannonical format, how can we change it in BI publisher, then how to calcualte minimum and as well as maximum.
    please advise me,
    Thanks,
    Sri

  • Using R function on Oracle data base

    for using R, I only can use Oracle data mining algorithms or I can use R function like social network in Oracle data base?

    Oracle Advanced Analytics provides multiple language (SQL, R and if we include GUIs, Oracle Data Miner workflow UI) support to the in-DB analytics. Using SQL, R or the ODM'r GUI, you can access a library of simple descriptive, summary and coparative statistics that have been implemented in the Oracle Database + a dozen hi-perf in-DB data mining algorithms (e.g. regression, decision trees, text mining, clustering, associations, anomaly detection, etc.) and solve a wide range of business and technical problems.
    Should you require additional techniques e.g. R CRAN packages, then Oracle Advanced Analytics supports that through R to SQL transparancy where it "pushes down" R language intentions to matching in-DB SQL functions e.g. ETL, stats and data mining OR it can make a callout to R via "embedded R mode" and have the Database manage the flow of data and the process.
    There is an OTN Discussion Forum that focuses entirely on the "R" aspects of the Oracle Advanced Analytics Option. I suggest that you re-post your questiion here R Technologies for additional discusssions and for the benefit of that Oracle Advanced Analytics/Oracle R Enterprise OTN forum/community.
    cb

  • Bug with min function applied to an attribute?

    Does anyone know if there is a bug with the minimum function when it is applied to an attribute?
    I have Accounts, Date, Sales Type and volume in my request.
    I have applied min(Date) in the fx of the Date column.
    My query is hitting the YAGO table even though non of the columns i am using is mapped onto a YAGO table.
    As a test I've removed the min function frem the Date column and applied it to the Account column.
    Again my query hits the YAGO table.
    Does anyone know if it is a bug or can someone propose a workaround?
    I am using OBIEE version 10.1.3.4.1090414.1922 on Windows XP.

    Hi,
    You can create a separate report and refer it into the column of main report by 'Filter based on results of another request'
    This should resolve
    Hope this helps
    Regards
    MuRam

Maybe you are looking for

  • PO creation-ME21n-Why SAP does not check company code and Plant relation

    Hi All, Does someone know, why SAP does not check Plant and company code relation at the time of PO creation or how can we put validation between plant and company code at the time of PO creation. <b>Example:</b> Suppose i have a company 0001 which i

  • How to Add a user defined field in transaction-PKMC?

    Could anyone tell me the step by step process of how to add a user defined field in transaction-PKMC? Moderator message: please do some research before posting. Edited by: Thomas Zloch on Jan 16, 2012

  • Reg.payment terms

    Hi [1].    Customer credit period =30 days Payment should be made by 2 installments 1st installment at the time of delivery i.e 30% (10 days from posting period) 2nd installment after 20 days i.e  remaining amount.(70%) i entered values in installmen

  • Quickinfo in ALV

    Hi Everyone, I have a small query Iam sure someone must have done it. Is it possible to attach quickinfo in ALV list. In my assignment I have to show the material description for a material number as quickinfo. Please let me know which parameter we n

  • COST IN A PRODUCTION ORDER

    How can i know after settling an order to which cost center the cost of that order is flowing?