Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 3rd, 2012, 10:58 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default query for fetching parent/child records in a single row

Hi,

I want to fetch both the parent and child records in a single row .
PFB the query for the same.
With this query iam able to get the record in a single row, but in my case
the dept and year are optional, so there will not be any data in table ,
so if i fetch , it should retreive as null for that particular field.

select one.name college, two.name student, three.name dept , four.name year from test4 one, test4 two, test4 three, test4 four where two.parentid = one.id and three.parentid = two.id and four.parentid = three.id
I tried using or/join clause, but did not work.Please suggest.


Regards,
Subha
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving a single value from a single column in a single row? Ron Howerton LINQ 2 May 17th, 2011 08:46 AM
fetching records from website avats General .NET 0 November 3rd, 2005 03:36 PM
Parent - Child Combo babloo81 JSP Basics 0 April 27th, 2005 01:46 PM
Parent and Child Records in Same Table owain SQL Language 12 October 27th, 2004 10:02 AM



All times are GMT -4. The time now is 01:07 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.