Trouble joining 3 tables

  • Thread starter Thread starter JJ297
  • Start date Start date
J

JJ297

I'm getting incorrect syntax error. Can someone tell me what I'm
doing wrong, here's my stored procedure:



select Titles.Title
From Titles

Inner Join Titleclassification on classifications.classificationid =
titleclassification.classificationid
Inner Join titlecassification.titleid = titles.titleid
 
Try this:

select Titles.Title
From Titles
Inner Join Titleclassification on classifications.classificationid =
titleclassification.classificationid
and titlecassification.titleid = titles.titleid


Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
 
Try this:

select Titles.Title
From Titles
Inner Join Titleclassification on classifications.classificationid =
titleclassification.classificationid
and titlecassification.titleid = titles.titleid

Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA






- Show quoted text -

Almost now I'm getting:

The column prefix 'classifications' does not match with a table name
or alias name used in the query.

select Titles.Title
From Titles
Inner Join Titleclassification on classifications.classificationid =
titleclassification.classificationid
and titleclassification.titleid = titles.titleid

Any ideas?
 
oops, how about this:

select Titles.Title
From Titles
Inner Join titlecassification on titlecassification.titleid = titles.titleid
Inner Join classifications on classifications.classificationid =
titleclassification.classificationid


Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
 
oops, how about this:

select Titles.Title
From Titles
Inner Join titlecassification on titlecassification.titleid = titles.titleid
Inner Join classifications on classifications.classificationid =
titleclassification.classificationid

Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA








- Show quoted text -

PERFECT! I see you added the word inner join twice. I get it now.
Thanks!
 
Great!

You specify "INNER JOIN" for each table you want to perform the inner
join on, and use the "<table.column>=<table.column>" notation for each
one so SQL knows how to match up the rows. This applies for Left and
Right joins, too.


Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
 
Back
Top