Friday, May 25, 2012

Inner Join for three tables?

You can use parenthesis:
Code:
Dim strsql2 = "SELECT employe.*, location.*, job.*
 FROM 
  (employe INNER JOIN location
   ON employe.ID_employe = location.ID_employe)
  INNER JOIN job
   ON employe.ID_employe = job.ID_employe 
 WHERE employe.ID_employe = " & Form3.manipulatedRow & " "
Or you can use the old method, preferred by many programmers, including myself:
Code:
Dim strsql2 = "SELECT employe.*, location.*, job.*
 FROM employe, location, job
 WHERE employe.ID_employe = location.ID_employe
   AND employe.ID_employe = job.ID_employe 
   AND employe.ID_employe = " & Form3.manipulatedRow & " "
http://forums.codeguru.com/showthread.php?t=382050

No comments:

Post a Comment