I have these tables:
I am trying to get the article_id, article_name, article_title, article_description
and article_date
from articles
and username
from users
by using a connecting table, user_articles
.
I have tried this code:
SELECT E.article_id, E.article_title, E.article_description, E.article_date, u.username
FROM articles AS E, users as u
INNER JOIN user_articles as A ON A.article_id = E.article_id
INNER JOIN users as u2 ON u2.user_id = A.user_id
WHERE E.article_status = 1
And I am getting this error message:
Msg 4104, Level 16, State 1, Line 3
The multi-part identifier "E.article_id" could not be bound.
I am using SQL Server 2012 Express.