not unique table alias error

Anyone know what would be causing this 'not unique table/alias' error?

ODBC Error Code = S1000 (General error)

[MySQL][ODBC 3.51 Driver][mysqld-4.0.24-nt]Not unique table/alias: 'articles'

SQL = "SELECT Category.acatid, Category.acategory, articles.writerid, articles.articleid, articles.articledate, articles.summary, articles.title, articles.words, articles.atype, articles.payonly, articles.requests, writers.fname, writers.lname FROM articles, writeres, Category INNER JOIN (writers INNER JOIN articles ON writers.writerid = articles.writerid) ON Category.acatid = articles.acatid WHERE articles.words>-1 AND category.acategory Like 'Business%' AND articles.articledate>Now()-8 ORDER BY articles.requests DESC, articles.articledate DESC"


Thanks,
Rick
bluskyGuyAsked:
Who is Participating?
 
ljw87505Connect With a Mentor Commented:
Hi Rick,

It appears that you reference the table "articles" twice.  You need to alias one of them to avoid ambiguity.  

SELECT ...
FROM *articles*, writeres, Category
INNER JOIN (writers INNER JOIN *articles* ON writers.writerid = articles.writerid) ON Category.acatid = articles.acatid
WHERE ...

I'm a little confused by the syntax after the INNER JOIN clause...should it really be something like

SELECT ...
FROM articles, writeres, Category
INNER JOIN (SELECT * FROM writers INNER JOIN articles ON writers.writerid = articles.writerid) x ON Category.acatid = x.acatid
WHERE ...

?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.