MySQL join query - Not unique table/alias
What could be wrong with this one? I am getting Error #1066 - Not unique table/alias: 'v'
SELECT v.newsid AS identifier, j.createdate AS DATE, j.newstext AS TEXT, j.uuid AS user, j.flags AS fcount, j.votes AS vcount, j.authornick AS nick
FROM votes v
INNER JOIN news v ON j.newsid = v.newsid GROUP BY v.newsid ORDER BY COUNT( v.newsid )
L开发者_C百科IMIT 20
you cannot use the same table alias multiple times. You are associated v
with votes
and table news
.
Change your query and alias references to something like
SELECT .....
FROM votes v
INNER JOIN news n ON ....
^^^ <=== Change this to something else
I think the news table's alias should be "j". You have used "j.newsid = v.newsid" in join statement
精彩评论