Home » SQL & PL/SQL » SQL & PL/SQL » Oracle join (oracle 10)
icon5.gif  Oracle join [message #308887] Tue, 25 March 2008 18:09 Go to next message
nidhi_fame@yahoo.com
Messages: 1
Registered: March 2008
Junior Member
TableA

hierarchy_id Child_level parent_level
1 4 null
1 3 4
1 2 3


TableB

Enitity_id level
1 4
1 3
1 2
1 1

Tablec
level level_type
1 1
2 2
3 2
4 3

Tabled

Entity_id Hierarchy_id
1 1
2 2



From the above tables i have to build a query that returns

Entity_id Hierarchy_id Child_level parent_level
1 1 4 null
1 1 3 4
1 1 2 3
1 null 1 null

How can i achieve this, the main problem i am facing is getting the child level '1' of type '1' in the result set,
as it is not linked to a hierarchy id.

Please suggest.
Re: Oracle join [message #308931 is a reply to message #308887] Wed, 26 March 2008 00:25 Go to previous messageGo to next message
mshrkshl
Messages: 247
Registered: September 2006
Location: New Delhi
Senior Member
please post in prescribed format.

in your desire result you need
1 null 1 null(last row)

what is logic behind it?

I donot think it is readable or understandable.do you think?

regards,


Re: Oracle join [message #308960 is a reply to message #308887] Wed, 26 March 2008 01:36 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Always post your Oracle version (4 decimals).

Post a test case: create table and insert statements.
Also post the result you want with these data.

Also post what you already tried.

Regards
Michel
Re: Oracle join [message #309267 is a reply to message #308960] Wed, 26 March 2008 23:37 Go to previous messageGo to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
Study Outer Join Concept.It seem's that u are using equijoin instead of outer joins.Surf google i hope u will find the results.
Re: Oracle join [message #309308 is a reply to message #309267] Thu, 27 March 2008 01:47 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please dont use IM/SMS speak.

Regards
Michel
oracle performance [message #309309 is a reply to message #309308] Thu, 27 March 2008 01:51 Go to previous messageGo to next message
sophiafethalisleo
Messages: 1
Registered: March 2008
Location: chennai
Junior Member
i'm new to oracle 9i performance tuning .......explain it
Re: oracle performance [message #309314 is a reply to message #309309] Thu, 27 March 2008 01:58 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This has nothing to do with performances, it is just SQL.

Post what is requested.

Regards
Michel
Re: oracle performance [message #309318 is a reply to message #309309] Thu, 27 March 2008 02:05 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
sophiafethalisleo wrote on Thu, 27 March 2008 06:51
i'm new to oracle 9i performance tuning .......explain it

Are you actually hijacking a thread and demanding that someone explains Performance and tuning to you? Laughing Laughing Laughing Laughing good luck with that Laughing Laughing Laughing oh stop it Laughing Laughing Laughing Laughing Ahhhhhhhhhh Best laugh I've had in a while.
READ THE FORUM GUIDELINES
READ THE MANUAL
Previous Topic: problem in converting Seconds to minute
Next Topic: Materialized View
Goto Forum:
  


Current Time: Wed Dec 07 05:06:31 CST 2016

Total time taken to generate the page: 0.10447 seconds