我目前工作的一些遺留系統和我在一張SQL的書面像這樣來了:請解釋SQL加入
SELECT
cel.id,
cel.campaign_id,
cel.campaign_name,
cel.campaign_message_type,
cel.responsible_user_id,
cel.responsible_user_full_name,
cel.person_id,
cel.email_template_id,
cel.email_message_subject,
cel.recipient_list_name,
cel.first_name,
cel.last_name,
cel.email_address,
b.message_content_html email_message_content_html,
b.message_content_text email_message_content_text,
b.course_presentation_id,
cp.phone_mobile
FROM
campaigns_email_logs cel
LEFT JOIN contacts_people cp ON
(cel.person_id = c.id),
campaigns_email b
WHERE
cel.campaign_id = b.id and
cel.status = 'queued' and
cel.datetime_start < now() and
cel.datetime_end > now() and
b.paused = 'no'
order by
{$campaignMessagesToSendOrdering};
請你能解釋一下什麼是LEFT JOIN campaigns_email是幹什麼的?它是否正在對contacts_people進行交叉連接?對於我來說,快速瞭解這一點,任何人都可以在不使用campaigns_email的情況下重寫它。
我知道你可以在from子句中有多個表,但我從來沒有見過這樣的情況。
謝謝。
這裏沒有人會爲你做你的工作,在這裏人們幫助你找到問題的解決方案,你試圖解決。至少檢查Dokumentation befor尋求幫助[加入Doku MySql](http://dev.mysql.com/doc/refman/5.1/de/join.html) –
@winner_joiner在問題中,他問你要做什麼他爲他工作? – jerdiggity
'任何人請重寫它,沒有,campaigns_email.' - 重寫沒有這個連接的查詢意味着不只是從查詢中刪除這個:',campaigns_email b' – AD7six