User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 402,620 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,294 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums

Data from Multiple Tables

Join Date: Apr 2008
Posts: 295
Reputation: tesuji is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 41
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: Data from Multiple Tables

  #2  
May 17th, 2008
hi deepman,
try this
  1. SELECT t.rollno, t.age, s.sex FROM table1 t
  2. JOIN table3 s ON t.rollno = s.rollno
  3. WHERE s.rollno = 1 OR s.rollno = 7
  4. union
  5. SELECT t.rollno, t.age, s.sex FROM table2 t
  6. JOIN table3 s ON t.rollno = s.rollno
  7. WHERE s.rollno = 1 OR s.rollno = 7
  8. union
  9. SELECT t.rollno, t.age, s.sex FROM table10 t
  10. JOIN table3 s ON t.rollno = s.rollno
  11. WHERE s.rollno = 1 OR s.rollno = 7
So far, i didn't test it.
what is the reason, that you have split the data over various tables?

krs,
tesu
Reply With Quote  
All times are GMT -4. The time now is 1:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC