FrenchMajesty FrenchMajesty - 1 year ago 109
MySQL Question

Unknown column in MySQL 5.7

I am performing this query:

SELECT, C.content, C.video_id,C.username, C.date_sent, SUM( AS vote_total
FROM comments C
LEFT OUTER JOIN comments_votes V
WHERE c.video_id = '5'
GROUP BY, C.content, C.username, C.video_id, C.date_sent, C.video_id
ORDER BY C.content ASC

And it works fine on my localhost which runs
but my host operates on
mySQL 5.7
and when I run the above I get:

Error in query (1054): Unknown column 'c.video_id' in 'where clause'

I am not very knowledgable on SQL but I tried to do some research on SO but most solutions point to a bug in 5.5.

My comments table is this:


Answer Source

It looks like one instance is configured as case-insensitive and the other not. Try to change to C.video_id (or better yet, never use uppercase in database identifiers).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download