SQL Language (MOSC)

MOSC Banner

Table join vs. function

edited Jun 8, 2010 2:49PM in SQL Language (MOSC) 10 commentsAnswered ✓
 Which is more efficient, joining two tables or calling a user-defined function to lookup a column value?

For Example:  select a.id, b.description from table_a a join table_b b on b.rec_id = a.id

                                                              or

                         select a.id, get_b_desc(a.id) from table_a a

The get_b_desc() function accepts an id, performs a select on table_b with the passed in id and returns the description value.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center