• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying 2 tables data in a single row

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(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
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic