wood burning stoves 2.0
The moose likes Oracle/OAS and the fly likes Displaying 2 tables data in a single row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Displaying 2 tables data in a single row" Watch "Displaying 2 tables data in a single row" New topic

Displaying 2 tables data in a single row

vamsikiran mallampalli

Joined: Oct 12, 2006
Posts: 18
I have 2 tables,t1 (parent table)and t2(child).
In t1 i have 10 columns and t2 has 4 columns.

In t1 and t2 there is a common column x.
For each record of this common column x -- (Eg:x=100)
t1 has 1 row data
t2 has 24 rows data.

The requirement is

Display T1's 1 row data and T2's 24 rows data as a single row.

THis should be done using a oracle query only.Later i need to display all these columns as a single row in front end.

I have used joins to join them but unable to display them as a single row data..
Any ideas?Please help me as early as possible as this is an urgent requirement.

Thanks in advanc
Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

(almost) Impossible in a plain sql query.

You would need to know upfront that t2 has exactly 24 rows for each t1 record,
then join in table t2 24 times,
meanwhile taking care that you don't join the same t2 record more than once.

Regards, Jan

OCUP UML fundamental and ITIL foundation
I agree. Here's the link: http://aspose.com/file-tools
subject: Displaying 2 tables data in a single row
It's not a secret anymore!