is my query wrong

Reply

Join Date: Nov 2007
Posts: 183
Reputation: lydia21 is an unknown quantity at this point 
Solved Threads: 5
lydia21 lydia21 is offline Offline
Junior Poster

is my query wrong

 
0
  #1
Aug 2nd, 2008
hi
i want to join four tables.i used left join.thougn value are there in my db all the datas from
seekers_qualification, seeker_target tables are getting displayed as Null.but there is no Sql error

  1. SELECT seekers.firstname, seekers.middlename, seekers.lastname, seekers.totalexperience, seekers.mobile, seekers_qualification.qualification, seeker_target.jobtitle, seeker_target.ann_salary, seeker_target.state, seeker_target.relocate
  2. FROM seekers
  3. LEFT JOIN (
  4. SELECT seekers.firstname, seekers.middlename, seekers.lastname, seekers.totalexperience, seekers.mobile, seekers_qualification.qualification, seeker_target.jobtitle, seeker_target.ann_salary, seeker_target.state, seeker_target.relocate
  5. FROM seekers
  6. LEFT JOIN (
  7. seekers_qualification, seeker_target
  8. ) ON ( seekers.seeker_id = seekers_qualification.seeker_id
  9. AND seekers_qualification.seeker_id = seeker_target.seeker_id
  10. AND seeker_target.seeker_id = seekers.seeker_id )
  11. WHERE seekers.seeker_id = '40'
  12. AND seeker_target.seeker_id = '40'
  13. OR seekers_qualification.seeker_id = '40'
  14. LIMIT 0 , 30
  15. ) ON ( seekers.seeker_id = seekers_qualification.seeker_id
  16. AND seekers_qualification.seeker_id = seeker_target.seeker_id
  17. AND seeker_target.seeker_id = seekers.seeker_id )
  18. WHERE seekers.seeker_id = '40'
  19. AND seeker_target.seeker_id = '40'
  20. OR seekers_qualification.seeker_id = '40'
  21. LIMIT 0 , 30
Last edited by peter_budo; Aug 2nd, 2008 at 2:31 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 183
Reputation: lydia21 is an unknown quantity at this point 
Solved Threads: 5
lydia21 lydia21 is offline Offline
Junior Poster

Re: is my query wrong

 
0
  #2
Aug 4th, 2008
sorry for the wrong query in the last post

"select seekers.firstname, seekers.middlename,seekers.lastname,seekers.totalexperience,seekers.mobile,seekers_qualification.qualification,seeker_target.jobtitle,seeker_target.ann_salary,seeker_target.state,seeker_target.relocate
from seekers left join (seekers_qualification,seeker_target)on(seekers.seeker_id=seekers_qualification.seeker_id and seekers_qualification.seeker_id=seeker_target.seeker_id and seeker_target.seeker_id=seekers.seeker_id) where seekers.seeker_id='$id'
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 195
Reputation: mwasif is an unknown quantity at this point 
Solved Threads: 27
mwasif mwasif is offline Offline
Junior Poster

Re: is my query wrong

 
0
  #3
Aug 6th, 2008
Can you tell the relation between all these tables?
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 183
Reputation: lydia21 is an unknown quantity at this point 
Solved Threads: 5
lydia21 lydia21 is offline Offline
Junior Poster

Re: is my query wrong

 
0
  #4
Aug 7th, 2008
seeker_id is commin in all the tables
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MySQL Forum


Views: 606 | Replies: 3
Thread Tools Search this Thread



Tag cloud for MySQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC