I have a sql query which run normally in local host but when i upload it to the real server where a higher version of MySQL is installed it give me error:
" #1054 - Unknown column 'subject.customers_fullname' in 'field list' "
Here is the query ...
SELECT nf.*,
actor.customers_fullname AS actor_name,
actor.customers_id AS actor_id,
subject.customers_fullname AS subject_name
FROM portal_notifications nf,
customers actor,
customers SUBJECT
WHERE subject_id = 1
AND nf.actor_id = actor.customers_id
AND nf.subject_id = SUBJECT.customers_id
AND status = 'unseen'
ORDER BY nf.id DESC LIMIT 0,10
Try to write this in field list because alisas name is SUBJECT
and you are used subject
which is case sensitive in UNIX
.
SUBJECT.customers_fullname AS subject_name
Instead Of
subject.customers_fullname AS subject_name
By default, table aliases are case sensitive on Unix, but not so on Windows or Mac OSX.
Alias name is case sensitive in UNIX
OS Reference.