Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Innter Join 1

Status
Not open for further replies.
Mar 17, 2005
147
0
0
US
How do I do an inner join on two or three tables where they all have the same entrydate feild lets say.

Select * from activity
Inner Join
activityout
on activity.entrydate = activityout.entrydate
 
your syntax looks correct to me.

Attitude is Everything
 
Like so,

Code:
Select * from table1 t1 inner join table2 t2
on t1.entrydate = t2.entrydate
inner join table3 t3 on t2.entrydate = t3.entrydate

T1, t2 and t3 are just aliases that you can omit if you want to add the tablename to the front of each field. Aliases are just an excuse to do less typing. @=)

Hope that helps. Just remember, that if a record does not exist in all three tables, it won't show up at all. If you want All records in T1, the matching records in T2 and the records that match in both from T3, use Left Outer Joins instead.



Catadmin - MCDBA, MCSA
"Just because I'm paranoid doesn't mean the universe *isn't* out to get me!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top