这在 mysql 4 中有效,但在 mysql 5 中无效。在我的新 centos 5.8 服务器 mysql 5.0.95 上的 phpmyadmin 中运行此查询
GIVES: #1054 - Unknown column 'thr.thread_address_id' in 'on clause'
所有表格均已验证。
在网上找到了将值移动到 FROM 子句末尾的建议,但它只是修复了该特定错误并为下一行创建了一个错误。
FROM thread th, address a, address ad, queue q, thread thr, ticket t(解决关于ticket t的警告)
FROM thread th,address a,address ad,queue q,ticket t,thread thr(解决关于thread thr的警告)
SELECT t.ticket_id, t.ticket_subject, t.ticket_priority, t.ticket_spam_trained,
t.last_reply_by_agent, t.ticket_spam_probability, th.thread_date, thr.thread_received,
t.ticket_status, t.ticket_due, th.thread_address_id, t.min_thread_id, a.address_address,
t.ticket_mask, t.ticket_time_worked as total_time_worked, ad.address_address as
requestor_address, ad.address_banned, q.queue_id, q.queue_name ,v_9.field_value as
g_3_custom_9 FROM thread th, address a, address ad, queue q, thread thr, ticket t LEFT
JOIN field_group_values v_9 ON (v_9.entity_index = IF ( v_9.entity_code = 'R',
thr.thread_address_id, t.ticket_id ) AND v_9.field_id = 9) WHERE 1 AND t.max_thread_id =
th.thread_id AND t.min_thread_id = thr.thread_id AND a.address_id = th.thread_address_id
AND ad.address_id = thr.thread_address_id AND q.queue_id = t.ticket_queue_id AND
t.ticket_id IN (172058,172036,172022,172012,171929,171387) GROUP BY t.ticket_id ORDER BY
thr.thread_received DESC