943,515 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 715
  • MySQL RSS
Aug 2nd, 2008
0

is my query wrong

Expand Post »
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

sql Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 19
Solved Threads: 5
Junior Poster
lydia21 is offline Offline
183 posts
since Nov 2007
Aug 4th, 2008
0

Re: is my query wrong

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'
Reputation Points: 19
Solved Threads: 5
Junior Poster
lydia21 is offline Offline
183 posts
since Nov 2007
Aug 6th, 2008
0

Re: is my query wrong

Can you tell the relation between all these tables?
Reputation Points: 29
Solved Threads: 47
Posting Whiz
mwasif is offline Offline
312 posts
since Dec 2007
Aug 7th, 2008
0

Re: is my query wrong

seeker_id is commin in all the tables
Reputation Points: 19
Solved Threads: 5
Junior Poster
lydia21 is offline Offline
183 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Update field troubles
Next Thread in MySQL Forum Timeline: insert checkbox values to database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC