Group by Lookup function result

I have a report that uses two datasets.
The first one looks like this. It's the time members have recorded under a particular job title:
ParentId TaskName ObjectiveId MemberId JobTitle TimeSpent Status
3174ED19 TEST 3 42AA79F6 23179C0F NULL 0.00 01
3174ED19 TEST 3 42AA79F6 596CA495 JobTitle1 9.00 01
3174ED19 TEST 1 AEE18C46 23179C0F NULL 0.00 01
3174ED19 TEST 1 AEE18C46 596CA495 JobTitle2 3.00 01
3174ED19 TEST 2 AEE18C46 23179C0F NULL 0.00 01
3174ED19 TEST 2 AEE18C46 596CA495 6.00 01
I need to show the records which have JobTitle == null with a particular Job Title, the current one they have in Active Directory. So I use another dataset from a WCF service:
MemberId Name JobTitle
23179C0F Member1 JobTitle1
Then I use a lookup function to show the correct Job Title:
=IIF(IsNothing(Fields!JobTitle.Value) OR Fields!JobTitle.Value = "",lookup(Fields!MemberId.Value,Fields!MemberId.Value,Fields!JobTitle.Value,"Members"),Fields!JobTitle.Value)
This works ok. The problem is that I need the data to be grouped by several fields, including the Job Title. It seems grouping happens before the lookup function is executed, so instead of grouping the NULL values along with the fields that contains the actual
values, I end up with two groups with the same Job Title, one containing the null values and another with the actual values.
Is there any workaround for this?
Thanks.

Hi EXR88,
Per my understanding that you have add some row group in the report to group the result which include the JobTitle from the table1 and also group by the field which result comes from the lookup funtion, now the issue is the group by the Lookup function result
isn't correct, right?
I have tested on my local envoronment and can't reproduce the issue, please find the details information below to make sure you have done the correct setting:
I tried to create the two tables like below:
Table1:
 Have the same recores as you provided above.
Table2:
MemberId    Name      JobTitle
23179C0F   Member1    JobTitle1
596CA495   Member1      NULL
After adding the LookUP function, i got the report like below:
I add two row group base on the JobTitle(JobTitle) and the Lookup functiuon result(Lookupfunctiongroup), the Lookupfunctiongroup row group is the child group of the JobTitle like below, please make sure you have add the expression with the lookupfunction
in the group on:
If i have some misunderstanding, please try to provide the expectted group by  result you want to get and also the currectly result you have got.
Any problem, please feel free to ask.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support

Similar Messages

  • USING LOOKUP FUNCTION IN CHART

    Good Afternoon,
    I have created a simple chart in SSRS that is sourced from Analysis Services. The Grouping is by Month and the values are just attendances per month.
    I want to add a 2nd series to this chart using a stored procedure in SQL.
    Both share the field Month and could be linked on that field.
    Does anybody know how I can use the lookup function to add this field to my chart.
    Thank you

    You can lookup by month. In the chart values, add a new series by clicking the Plus icon and choosing Expression. You expression should look something like:
    =Lookup( Fields!AS_Month.Value, Fields!SP_Month.Value, Fields!SP_Value.Value, "SP_Dataset" )
    The abbreviation AS refers to your analysis services dataset, while the SP refers to your dataset using the stored procedure. The expression matches each month used in the chart (the category group) with the month in the other data set, and retrieves the
    SP_Value field to show on the chart.
    If the month numbers/names match exactly, then it will work fine.
    Regards,
    Andrew Borg Cardona

  • Function result as an item for another function.

    I have a report that has a field A(number) which is the result of a custom function. My next field B needs to sum up all these results i.e. sum of field A grouped by certain field. Another field C needs to divide field B by a calculated number etc.
    Because I can't choose function result as an Item, I'd have to recalculate for field B, and again for field C etc, which degrades performance.
    Any ideas on how to tackle this problem?

    Dear Peter,
    Does this amount appear as an amount in your GL and missing in your Asset Accounts, or vice versa.
    Please, do check if there are any manual postings performed from FI, not from the depreciation program.
    They will disappear from ABST2 when you reverse them from FI.
    KR
    Severina
    Edited by: Severina Koleva on Feb 22, 2010 3:55 PM

  • Using lookup function but to show multiple returns?

    Okay so I have been talked through how to use a lookup function to show which student in my class has scored the highest grade.  The formula used displays there name in one column and the score they achieved in another column which I have set up in a small seperate table.  However as suggested in my intial lookup function search it was suggested that I would encounter a problem if two students both achieved the same highest score.  However in the results table I have created it only shows one student.  Is it possible to have a function or formula that will simply show the top scores and the students that scored it when they are tied? 
    Thanks
    Marcus

    The easiest way to accomplish this, Marcus, is by simply sorting all rows by grade.  Sure, you can click on the column tab and hit "sort ascending", but I'm guessing you want something a little more dynamic than that.
    So I've set up a class of 20 students and gave them all random grades btwn 40 - 99.  (That's how it was done when I was in high school.  )  I added a third column which takes that grade, multiplies it by 1000, and adds the row number of the student.  This creates a unique identifier based on a possibly-non-unique grade:
    Now it's simply a matter of using the LARGE function to rank these new identifiers, and then using LOOKUP to get the actual grade and name for that identifier.  (Note that the grades changed; changing the focus from one cell to another creates new random values for the grades.)
    The formula for columns b and c for this Ranking table are standard Lookup functions:
    =LOOKUP($A1,Grades :: $C,Grades :: $B) to get the grades  ($A2 for 2nd column, etc.), and
    =LOOKUP($A1,Grades :: $C,Grades :: $A) to get the names.
    I'd suggest hiding these identifier columns.
    Now, to limit this display to the "X" highest grades, I'm going to continue this into another reply.
    Vince

  • Populating a collection with function results

    I am calculating some statistics and need to use a collection to store the results of several function so they can be used in a procedure. Example:
    PROCEDURE PRODUCTIVITY_INSERT(p_first_of_month IN DATE)
    AS
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    FOR i IN 1..3 loop
    EXECUTE IMMEDIATE 'INSERT INTO RFC_BUS'||days(i)||'PRODUCTIVITY(ROUTE,PPPH)
    SELECT a.route, ((sr05 / sy05)/'||counts(i)||') AS "RATIO"
    FROM (SELECT route,
    SUM (DECODE (TO_CHAR (pick, "MM-YYYY"),
    to_char(vc_FirstofMonth, "MM-YYYY"), platform_hours, null)) AS sy05
    FROM bus_platformhours
    WHERE day_type ='||days(i)||' and platform_hours > 0
    GROUP BY route) a,
    (SELECT route,
    SUM (DECODE (TO_CHAR (service_date, "mm-yyyy"),
    to_char(vc_FirstofMonth, "MM-YYYY"), rides, null)) AS sr05
    FROM bush_daily_rides
    WHERE day_type = '||days(i)||
    'GROUP BY route) b
    WHERE a.route = b.route
    ORDER BY a.route
    VALUES(
    p_route,
    p_ratio
    ) USING days(i), counts(i)';
    end loop;
    Can I use collections to hold the function results (say three function out variables) while they are being looped through in the procedure? If I can do that I am presuming I use the functions name in the collection such as:
    TYPE dayoneList IS TABLE OF NUMBER;
    dayone dayoneList := dayoneList(wkdaysminusone(), sadaysminusone(), sudaysminusone());
    thanks for any help you can give me.

    Do you mean to use the functions as the elements of collection constructor ?
    It's possible:
    SQL> create function get_one return number is begin return 1; end;
      2  /
    Function created.
    SQL> create function get_two return number is begin return 2; end;
      2  /
    Function created.
    SQL> declare
      2   type arr is table of number;
      3   arr1 arr := arr(get_one(), get_two());
      4  begin
      5   for i in 1..arr1.count loop
      6    dbms_output.put_line(arr1(i));
      7   end loop;
      8  end;
      9  /
    1
    2
    PL/SQL procedure successfully completed.Rgds.

  • Aggregate using Lookup function

    Is there any way to get a sum or average of data from a dataset using a Lookup function?
    I have daily currency data, and want to use a lookup function to get monthly averages - at this stage, the lookup function will only return the data for the first entry of the month.
    Thanks

    Hi MIDASuer,
    Per my understanding that you want to get the sum or monthly average value based on the daily currency data, right?
    I have tested on my local environment and I assumed that you have an date/time type field in the table, if so, we can get the month value based on the daily date and then create row group based on the month, finally we can use the avg or sum function
    to get the monthly average values.
    Detail information below for your reference:
    We can modify the query in the dataset to get the month value from the date:
    SELECT   Amount, Date, DATEPART(month, Date) AS Month
    FROM      TableName
    Add an row gorup of the month(Month)
    Use expression below to get the average value of the month and the sum of the month:
    Monthly Average: =Avg(Fields!Amount.Value,"Month")
    Monthly Sum :  =Sum(Fields!Amount.Value,"Month")
    If the amount value comes from another dataset using the lookup function, you can use expression below o get the monthly average:
    =Avg(Lookup(source_expression, destination_expression, result_expression, dataset),Month")
    preview like below:
    More details information about the LookUp function for your reference:
    https://technet.microsoft.com/en-us/library/ee210531(v=sql.110).aspx
    If your problem still exists, please try to provide us some sample data and more detail information about your requirements.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Unknown Dimension Name in Keyword "0):    LOOKUP function

    Hi,
    I am doing Migration project. from BPC MS to NW 7.5 In this I have vallidated the logics in the NW version as per MS version.
    I got only one error when I validate the LOOKUP function in the NW under the same application(Staff_Additions).
    The error message: "Unknown Dimension Name in Keyword "0):"
    Could you please help me in this and please find the code below.
    *Lookup Staff_Additions
    *DIM SALARY="Salary_redis"     
    *DIM CATEGORY="Budget"     
    *DIM CLIENT_GROUP="1010"     
    *DIM DATASRC="Input"     
    *DIM INTCO="Non_Interco"     
    *DIM RPTCURRENCY="LC"     
    *DIM TIME="2011.MAR"
    *DIM ACCOUNT="41000"
    *ENDLOOKUP
    *WHEN CATEGORY
    *IS = "BUDGET"
    *WHEN INTCO
    *IS = "Non_InterCo"
    *WHEN JOB_TITLE.ID
    *IS = "No_JobTitle"
    *WHEN SALARY
    *IS = "Salary_Redis"
    *WHEN RPTCURRENCY
    *IS = "LC"
    *WHEN DATASRC
    *IS = "INPUT"
    REC(EXPRESSION=ROUND(.07692 Lookup(Staff_Additions),0),Time="2010.APR",SALARY="SALARY_MO")
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    Thanks and Regards,
    Krishna.

    Hi,
    My intension is multiple with  .06792 and make it round figure and store the value in 2010.MAR.
    I have modified this logic in the NW Version,It shown below.
    *Lookup Staff_Additions
    *DIM SALARY="Salary_redis"     
    *DIM CATEGORY="Budget"     
    *DIM CLIENT_GROUP="1010"     
    *DIM DATASRC="Input"     
    *DIM INTCO="Non_Interco"     
    *DIM RPTCURRENCY="LC"     
    *DIM TIME="2011.MAR"
    *DIM ACCOUNT="41000"
    *ENDLOOKUP
    *WHEN CATEGORY
    *IS = "BUDGET"
    *WHEN INTCO
    *IS = "Non_InterCo"
    *WHEN JOB_TITLE
    *IS = "No_JobTitle"
    *WHEN SALARY
    *IS = "Salary_Redis"
    *WHEN RPTCURRENCY
    *IS = "LC"
    *WHEN DATASRC
    *IS = "INPUT"
    REC(EXPRESSION=.07692(Staff_Additions),TIME=2010.APR,SALARY=Salary_MO)
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    Let me know is this the right procedure to get the right result.
    Could you please help me in this.
    Thanks and Regards,
    Krishna.

  • Is there a way of getting LOOKUP function to return the address of a cell rather than the value?

    Hi
    I am wondering if there is a way of converting the value found in a LOOKUP function into a reference for the cell in question.
    I have constructed the following formula:
    =OFFSET(LOOKUP(A2,August :: $A),2,2)
    In an attempt to return the value of a cell which is two rows and two columns away from the cell returned by a LOOKUP function.
    But I am getting the error Argument 1 of OFFSET expects a reference but found "Name."
    Could someone advise?
    Thanks,
    Nick

    nick_harambee wrote:
    Hi
    I am wondering if there is a way of converting the value found in a LOOKUP function into a reference for the cell in question.
    I have constructed the following formula:
    =OFFSET(LOOKUP(A2,August :: $A),2,2)
    In an attempt to return the value of a cell which is two rows and two columns away from the cell returned by a LOOKUP function.
    But I am getting the error Argument 1 of OFFSET expects a reference but found "Name."
    Could someone advise?
    Thanks,
    Nick
    Nick,
    To find the row that a searched-for value is in, use MATCH.
    Jerry

  • SSRS countrow Aggregate error(Aggregate and lookup functions cannot be used in query parameter expressions.)

    Below expression works fine with text box but gives error in dataset expression.
    ="SET FMTONLY OFF select  "+ join(Parameters!Column.Value,",") +" FROM pamcustom.dbo.vw_HFL_HFD_HotfileData INNER JOIN pamcustom.dbo.HFL_HFB_HotFileBatch  on BatchID = HFB_intBatchID where BatchID ="+Parameters!BatchId.Value+"
    and "+Parameters!cmbTranType.Value+" "+ iif(CountRows("DS_Aml_Mnr_Iss_Desc")=Parameters!Mnr_Iss_Desc.count," "," and aml_mnr_iss_desc in "+"('" & join(Parameters!Mnr_Iss_Desc.Value,"','")
    & "')")+iif(CountRows("ds_ReportingCategory")=Parameters!ReportingCategory.count," "," and ReportingCategory in "+"('" & join(Parameters!ReportingCategory.Value,"','") & "')")+iif(CountRows("ds_NAICSubGroup")=Parameters!NAICSubGroup.count,"
    "," and naicsubgroup in "+"('" & join(Parameters!NAICSubGroup.Value,"','") & "')")+iif(CountRows("ds_PortTrading")=Parameters!PortTrading.count," "," and porttrading in "+"('"
    & join(Parameters!PortTrading.Value,"','") & "')")+iif(CountRows("ds_GL_LE")=Parameters!GL_LE.count," "," and gl_le in "+"('" & join(Parameters!GL_LE.Value,"','") &
    "')")+iif(CountRows("ds_coagroup")=Parameters!cmbCoaGrp.count," "," and coagroup in "+"('" & join(Parameters!cmbCoaGrp.Value,"','") & "')")+iif(CountRows("Portfolio")=Parameters!cmbPort.count,"
    "," and portfolio in "+"('" & join(Parameters!cmbPort.Value,"','") & "')")+IIf(IsNothing(Parameters!txtSecID.Value)," "," and secid in ('"+Replace(Parameters!txtSecID.Value,",","','")+"')")+iif(IsNothing(Parameters!minPortFilter.Value)
    and IsNothing(Parameters!MinPort.Value)," "," and portfolio "+Parameters!minPortFilter.Value+Parameters!MinPort.Value)+iif(IsNothing(Parameters!maxPortFilter.Value) and IsNothing(Parameters!MaxPort.Value)," ","
    and portfolio "+Parameters!maxPortFilter.Value+Parameters!MaxPort.Value)+iif(IsNothing(Parameters!minCoaFilter.Value) and IsNothing(Parameters!txtMinCoa.Value)," "," and portfolio "+Parameters!minCoaFilter.Value+Parameters!txtMinCoa.Value)+iif(IsNothing(Parameters!maxCoaFilter.Value)
    and IsNothing(Parameters!txtMaxCoa.Value)," "," and portfolio "+Parameters!maxCoaFilter.Value+Parameters!txtMaxCoa.Value)
    I guess the error " Aggregate and lookup functions cannot be used in query parameter expressions." is because I am using CountRow to ensure that if all values of multi select all selected i will not use that filter in where clause.
    Pls. guide...

    Hi, Include your parameter total count in the dataset for parameter and instead of using countrows() function use the count from dataset in the expression.
    Hope this helps.........
    Ione

  • Weblogic 10.3.0 -  Security Violation when Group Membership Lookup enabled

    Dear Admins,
    We're running a Weblogic 10.3.0 cluster with our own software deployed.
    We're using SQL authentication (JDBC to Oracle DB) to authenticate users.
    Recently we've been tuning our WL cluster to improve performance, and have enabled Group Membership Lookup Hierarchy Caching.
    Sometimes users log into our application and get inssuficient rights (or some other error). This appears to happen at random. Most of the times they can log in without problems.
    We determined it's not something to do with the cluster, although it can happen on one node and the other node will work as normal.
    In the Managed server we see this error (with test user):
    Managed7Server.out00011:java.rmi.AccessException: [EJB:010160]Security Violation: User: 'test' has insufficient permission to access EJB: type=<ejb>, application=leanapps, module=process_general.jar, ejb=LaLifeProcessController,
    method=create, methodInterface=Home, signature={}.
    When we disable Group Membership Lookup Hierarchy Caching, this error never occurs.
    Our settings (Security Realms -> myrealm -> Providers -> SQL Authenticator -> Performance):
    Max Group Hierarchies In Cache: 5000 (we have approx. 2000 groups)
    Group Hierarchy Cache TTL: 3600
    provider specific settings :
    Group Membership Searching: unlimited
    Max Group Membership Search Level: 0
    Also in Myrealm -> Performance we have set :
    Enable WebLogic Principal Validator Cache
    Max WebLogic Principals In Cache: 5000
    If we put the TTL really low (default 60 seconds), the error hardly ever occurs. But we want to have cache that lasts longer then one minute.
    This might be a bug, as we have other clusters running on WL 10.3.5, 12c where we use the same cache settings. This issue does not occur there.
    I'm more then willing to provide more info or config files
    Edited by: user5974192 on 21-nov-2012 5:17

    This is fixed now. Someone had defined a Servlet for the web service in web.xml that was preventing the EJB container to kick in.
    Edited by: user572625 on Aug 25, 2011 11:54 PM

  • Dense Lookup Function in OBIEE

    Hi ,
    Can someone please explain the syntax of Dense Lookup Function in OBIEE.
    The function in the built-in RPD is using too many arguments and I am not able to understand it.
    Thanks in Advance for the help.
    Akshatha

    I had actually seen all those links. Thanks for your time although.
    Actually, I have an expression like this.
    lookup( DENSE LookupTable.DOMAIN_MEMBER_NAME, 'MCAT', 'CMP' || '~' || Table_A.TOP_LVL_PRODCAT_ID, VALUEOF(NQ_SESSION.USER_LANGUAGE_CODE), Table_A.DATASOURCE_NUM_ID)
    I am not sure of what 'MCAT' and 'CMP' is here?
    Is the || the concatenation operator?
    Can you please explain this expression?
    I hope I am not asking too much here :/
    Akshatha

  • Lookup functionality

    Hi Guru's,
    How to implement informatica's lookup functionality in ODI. Any help is appreciated.
    Thanks,
    Navin Kumar Bolla

    Have a read of :- Lookups in ODI
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • There is an error in the process of validating the lookup function in NW

    Hi,
    I got an error in the script logic validation.
    I  write a lookup function and validate the logic, In this one error occurred "Invalid lookup strecture: Invalid appl name"
    The logic code:
    *LOOKUP Staff_Additions                
    *DIM Salary="Salary_redis"     
    *DIM Category="Budget"     
    *DIM Client_Group="1010"     
    *DIM DataSrc="Input"     
    *DIM Intco="Non_Interco"     
    *DIM RptCurrency="LC"     
    *DIM Time="2011.MAR"
    *DIM Account="41000"
    *ENDLOOKUP
    *When Category.ID
    *Is = "Budget"
    *WHEN INTCO.ID
    *Is = "NON_INTERCO"
    *When JOB_TITLE.ID
    *Is = "NO_JOBTITLE"
    *When SALARY.ID
    *Is = "SALARY_REDIS"
    *When RptCurrency
    *Is = "LC"
    *When DATASRC
    *Is = "INPUT"
    REC(Expression=ROUND(.07692 Lookup(Staff_Additions),0),Time="2010.APR",SALARY="SALARY_MO")
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    Could you please send a solution for this as early as possible.
    Thanks and Regards,
    Krishna.

    Hi,
    I think you have confused in your syntax "Model" and "Lookup ID".
    The syntax of Lookup is this:
    *LOOKUP
    *DIM [:]="Value" | [.]
    So when you reference your lookup variable in the *REC statement it should look something like this:
    REC(Expression=ROUND(.07692 Lookup(<LOOKUP ID>),0),Time="2010.APR",SALARY="SALARY_MO")
    whereas now you have:
    REC(Expression=ROUND(.07692 Lookup(<MODEL>),0),Time="2010.APR",SALARY="SALARY_MO")
    HTH
    Matthias

  • Function result Cache in oracle 11G

    Hi,
    i am reading the following article and trying to reproduce same set of statements to learn about function result cache.
    http://www.oracle.com/technology/oramag/oracle/07-sep/o57asktom.html
    Details about my output:
    SQL> create or replace
    function not_cached
    ( p_owner in varchar2 )
    return number
    as
    l_cnt number;
    begin
    select count(*)
    into l_cnt
    from t
    where owner = p_owner;
    sys.dbms_lock.sleep(1);
    return l_cnt;
    end;
    Function created.
    Elapsed: 00:00:00.13
    SQL> create or replace
    function cached
    ( p_owner in varchar2 )
    return number
    result_cache
    relies_on(T)
    as
    l_cnt number;
    begin
    select count(*)
    into l_cnt
    from t
    where owner = p_owner;
    dbms_lock.sleep(1);
    return l_cnt;
    end;
    Function created.
    Elapsed: 00:00:00.08
    SQL> exec dbms_output.put_line( not_cached( 'SCOTT' ) );
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.06
    SQL> exec dbms_output.put_line( not_cached( 'SCOTT' ) );
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.01
    SQL> SQL> exec dbms_output.put_line( not_cached( 'SCOTT' ) );
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.02
    SQL> SQL> set serveroutput on
    SQL> exec dbms_output.put_line( not_cached( 'SCOTT' ) );
    0
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.02
    SQL> SQL> exec dbms_output.put_line( cached( 'SCOTT' ) );
    0
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.02
    SQL> SQL> exec dbms_output.put_line( cached( 'SCOTT' ) );
    0
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.02
    SQL> SQL> exec dbms_output.put_line( cached( 'SCOTT' ) );
    0
    PL/SQL procedure successfully completed.
    SQL> exec dbms_output.put_line( cached( 'SCOTT' ) );
    0
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.01
    I am supposed to get the results quickly for "cached" call. However, i still dont see any change in the response time. May i know what i am missing here?
    Thank you
    Giridhar

    Try to play with
    RESULT_CACHE_MAX_SIZE
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/initparams206.htm#REFRN10272
    RESULT_CACHE_MAX_RESULT
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/initparams205.htm#REFRN10298

  • Refering alias of a function result in an sql statement

    Dear Sir,
    How to refer an alias of a function result in sql statement?
    eg.(new_name is the alias)
    select myfunction(name) new_name
    from mytable
    where new_name = '#vincent#';
    I can't refer new_name in the above statement coz it gives an error "invalid column name".
    But I don't want to put the myfunction(name) again in the where clause which will double the job. So, how should I refer to it?
    Please advise.
    Thanks.
    null

    You can not refer to the alias like you are talking. You will have to use myfunction(name) as you have said. Or you can try creating a view with query:
    select myfunction(name) new_name
    from mytable
    and then refer to "new_name".
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by guest2000:
    Dear Sir,
    How to refer an alias of a function result in sql statement?
    eg.(new_name is the alias)
    select myfunction(name) new_name
    from mytable
    where new_name = '#vincent#';
    I can't refer new_name in the above statement coz it gives an error "invalid column name".
    But I don't want to put the myfunction(name) again in the where clause which will double the job. So, how should I refer to it?
    Please advise.
    Thanks.<HR></BLOCKQUOTE>
    null

Maybe you are looking for