Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to map more than three table.

 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have three table into database named as:
1- program:
it contains following data field-(sr_no,package,programtype, )
2-enquiry:
it contains following data field-(sr_no,date, recieptno, amount, startdate, expirydate)
3-member:
it contains following data field-(sr_no,membername, trainername)

and i want to show the table as given bellow. but i am not getting that what will be sql select query for this...
can somebody write query for bellow table...

please reply me soon...

Report Details:

Date |Member Name| Package | Receipt No. | Amount | Trainer Name | Start Date | Expiry Date | Program Type |





thanks:
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are asking about SQL I think you meant to post this in the JDBC forum Moving it there for you.
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see how a query like this is possible with the tables as you have them. I don't see any relationships between these tables.
 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am really sorry....that i missed one column name sr_no in all three table..now i have added.
i would like to say thanks to Mr. Bill for the valuable suggestion...
so please reply me that what should be the sql select query for the above table??


waiting for your reply!
thanks..
 
chris webster
Bartender
Posts: 2407
33
Linux Oracle Postgres Database Python Scala
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vivek Bhardwaj wrote:I am really sorry....that i missed one column name sr_no in all three table..now i have added.
i would like to say thanks to Mr. Bill for the valuable suggestion...
so please reply me that what should be the sql select query for the above table??

You'll learn much more if you try working this out yourself, so take a look at this introduction to SQL joins, and you should be able to figure out how to join your tables using your common (key) column. Get the join condition right first, then you simply need to include the columns you want to fetch in your SELECT clause.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic