MySQL-错误代码:1054。“on子句”中的未知列“task\u log\u wip.task\u log\u task”

MySQL-错误代码:1054。“on子句”中的未知列“task\u log\u wip.task\u log\u task”,mysql,Mysql,我对一个问题有点奇怪。此查询可用于: SELECT task_log_wip.* FROM task_log_wip INNER JOIN tasks ON tasks.task_id = task_log_wip.task_log_task; 但这个查询不起作用: SELECT task_log_wip.*, xmlform.* FROM task_log_wip, xmlform INNER JOIN tasks ON tasks.task_id = task_log_wip.task_l

我对一个问题有点奇怪。此查询可用于:

SELECT task_log_wip.*
FROM task_log_wip
INNER JOIN tasks ON tasks.task_id = task_log_wip.task_log_task;
但这个查询不起作用:

SELECT task_log_wip.*, xmlform.*
FROM task_log_wip, xmlform
INNER JOIN tasks ON tasks.task_id = task_log_wip.task_log_task;
添加任何类型的表以选择和从中选择将产生以下错误:

错误代码:1054。“on子句”中的未知列“task\u log\u wip.task\u log\u task”

表任务日志在制品结构:

task_log_id
task_log_task
task_log_name
task_log_description
task_log_creator
task_log_hours
task_log_date
task_log_costcode
task_log_xmlform_id
task_log_xmldoc
task_log_uniqueid
task_log_javascript_executed
task_log_fm_related_date
task_log_draft
task_log_status
task_log_approver
task_log_approval_date
task_log_pre_delete_status
task_log_deletion_approver
task_log_deletion_date
task_log_orig_creator
task_log_wip_auto_save
task_log_orig_created
task_id
task_name
task_parent
task_milestone
task_project
task_owner
task_start_date
task_duration
task_duration_type
task_hours_worked
task_end_date
task_status
task_priority
task_percent_complete
task_description
task_target_budget
task_related_url
task_creator
task_order
task_client_publish
task_dynamic
task_access
task_notify
task_departments
task_contacts
task_custom
task_xmlform_id
task_procedure
task_virtual
task_ypaccess
task_created_ts
表任务结构:

task_log_id
task_log_task
task_log_name
task_log_description
task_log_creator
task_log_hours
task_log_date
task_log_costcode
task_log_xmlform_id
task_log_xmldoc
task_log_uniqueid
task_log_javascript_executed
task_log_fm_related_date
task_log_draft
task_log_status
task_log_approver
task_log_approval_date
task_log_pre_delete_status
task_log_deletion_approver
task_log_deletion_date
task_log_orig_creator
task_log_wip_auto_save
task_log_orig_created
task_id
task_name
task_parent
task_milestone
task_project
task_owner
task_start_date
task_duration
task_duration_type
task_hours_worked
task_end_date
task_status
task_priority
task_percent_complete
task_description
task_target_budget
task_related_url
task_creator
task_order
task_client_publish
task_dynamic
task_access
task_notify
task_departments
task_contacts
task_custom
task_xmlform_id
task_procedure
task_virtual
task_ypaccess
task_created_ts
表xmlform结构task_log_wip通过task_log_wip_xmlform_id与xmlform连接:


因此,您需要对xmlform表进行如下连接或左连接:

SELECT task_log_wip.*, 
       xmlform.*
 FROM task_log_wip
       INNER JOIN tasks 
          ON tasks.task_id = task_log_wip.task_log_task
       INNER JOIN xmlform
          ON xmlform.id = task_log_wip.task_log_wip_xmlform_id;

“联接”或“左联接”选项将取决于您的数据和要求。

如果您想要查询所建议的整个笛卡尔计划,则需要将表xmlform与其他表联接或交叉联接。无论哪种方式,都没有足够的关于该表的信息来为您提供答案……我还应该提供哪些其他信息xmlform表的结构以及它与其他表的关系。添加了xmlform结构。