2017-06-05 3 views
-2

クエリで少し奇妙な問題があります。このクエリは動作します:MySQL - エラーコード:1054. 'on節'の 'task_log_wip.task_log_task'が不明です

SELECT task_log_wip.* 
FROM task_log_wip 
INNER JOIN tasks ON tasks.task_id = task_log_wip.task_log_task; 

しかし、このクエリは動作しませんが:

エラーコード:1054

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

SELECTとFROMするテーブルのいずれかの種類を追加し、次のエラーが生成されます。不明な列 'on clause'の 'task_log_wip.task_log_task'

task_log_wip構造:

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_id 
xmlform_project_type 
xmlform_project_type_parent 
xmlform_type 
xmlform_name 
xmlform_description 
xmlform_dtd 
xmlform_edit_rule_value 
xmlform_company_id 
xmlform_department 
xmlform_creator_id 
xmlform_shared 
xmlform_notify_via_email 
xmlform_notify_via_sms 
xmlform_notify_via_pager 
xmlform_notify_via_instant_messenger 
xmlform_report_severity_level 
xmlform_hidden 
xmlform_released 
xmlform_restricted 
created_by 
created_timestamp 
last_updated_by 
last_updated_timestamp 
+0

テーブルxmlformを他のテーブルに結合するか、クエリーが示唆するように全体のデカルト計画を必要とする場合は、クロス結合する必要があります。 –

+0

いずれにしても、そのテーブルに関する情報が不足しているため、回答が得られません... –

+0

何を追加する必要がありますか? – Sasha

答えて

1

ですから、このようなxmlform表とのJOIN JOINまたはLEFTするか必要があります。

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; 

JOINまたはLEFTの選択に参加するあなたのデータや要件に依存します。

+0

これは動作しています:)。助けてくれてありがとう :) – Sasha

関連する問題