Home » SQL & PL/SQL » SQL & PL/SQL » which function or code can replace joins
which function or code can replace joins [message #442277] Sat, 06 February 2010 07:49 Go to next message
navin_deep
Messages: 18
Registered: November 2009
Junior Member
Hi
I have been asked such a question in interview that : Which function or code can replace join condition on tables and still gives the same result ?

Please let me know if any such thing is possible.

regards
--navin
Re: which function or code can replace joins [message #442284 is a reply to message #442277] Sat, 06 February 2010 08:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
None.

Regards
Michel
Re: which function or code can replace joins [message #442295 is a reply to message #442284] Sat, 06 February 2010 11:09 Go to previous messageGo to next message
John Watson
Messages: 8964
Registered: January 2010
Location: Global Village
Senior Member
I wonder if they were talking about this sort of thing:
select count(1) from emp natural join dept where dept.dname='SALES';
select count(1) from emp where emp.deptno in (select dept.deptno from dept where dept.dname='SALES');

If so, you will need to research star transformations and bitmap indexes before your second interview. Better not mention such things unless you can back it up with some proof that you have studied them! The Data Warehousing Guide is a good place to start, http://download.oracle.com/docs/cd/E11882_01/server.112/e10810/toc.htm
Re: which function or code can replace joins [message #442311 is a reply to message #442277] Sat, 06 February 2010 18:16 Go to previous messageGo to next message
GeneGreen61
Messages: 2
Registered: February 2010
Location: Philly
Junior Member
Maybe they meant a function, which will return a value from the other table,based on some parameter(s)?
Something like
select ename, f_get_dname(deptno) dname
from emp;

Re: which function or code can replace joins [message #442352 is a reply to message #442311] Sun, 07 February 2010 03:27 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
No matter what they meant, you should have responded "WHY???"
Why would anyone ever replace perfectly good and supported syntax?
Previous Topic: Add patition to existing table
Next Topic: simple sql
Goto Forum:
  


Current Time: Sat Feb 08 07:43:10 CST 2025