0
我試圖端口延遲招聘到Haskell和我無法理解在DJ火災輪詢下一個作業的查詢WHERE
子句:試圖瞭解延遲作業輪詢查詢
UPDATE "delayed_jobs"
SET locked_at = '2017-07-18 03:33:51.729884',
locked_by = 'delayed_job.0 host:myhostname pid:21995'
WHERE id IN (
SELECT id FROM "delayed_jobs"
WHERE
(
(
run_at <= '2017-07-18 03:33:51.729457'
AND (locked_at IS NULL OR locked_at < '2017-07-17 23:33:51.729488')
OR locked_by = 'delayed_job.0 host:myhostname pid:21995'
)
AND failed_at IS NULL
) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *
結構在WHERE
條款如下:
(run_at_condition AND locked_at_condition OR locked_by_condition)
AND failed_at_condition
- 有沒有設置內部括號中
run_at_condition AND locked_at_condition OR locked_by_condition
失蹤的? AND/OR子句的優先級是什麼? locked_by_condition
目的是什麼好像被挑選出已被當前DJ流程鎖定的作業?!
你在問關於SQL,但是你用兩個不相關的標籤而不是用SQL來標記你的問題。 –
讓我知道Haskell是怎麼樣的) – Chris
@ReinHenrichs感謝您指出:) –