Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

nested function() in select statement

scottjhnFeb 22 2014 — edited Feb 22 2014

Oracle 11g. Try to nest a function in the select statement.  Purpose: get the average customer rating for each of the user qualified.

select user_name, f_get_avg_cust_rating() 'Rating'

from TAB_USER u, OTHER_TABLES o

where u.id = o.id and other condition matched;

How would Oracle process the sql.  Is it

1) First screen records based on the where clause, then call the f_get_avg_cust_rating() for each of the selected records   OR

2) While scanning the tables,  the f_get_avg_cust_rating() will be called for each record encountered?

Thanks

Scott

This post has been answered by AnnEdmund on Feb 22 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2014
Added on Feb 22 2014
4 comments
1,388 views