所以我有这个查询,可以“看看有什么不对”
SELECT tasks.id,tasks.client_name,tasks.description,tasks.state,
tasks.planned_dates, tasks.task_for, tasks.task_type,
tasks.solution, tasks.created_by, users.color
FROM public.tasks
INNER JOIN public.users ON (tasks.created_by = users.id)
WHERE id IN
(
SELECT tt.id
FROM (
SELECT id, unnest(planned_dates) as dd
FROM tasks
WHERE planned_dates IS NOT NULL AND deleted = FALSE
) as tt
WHERE tt.dd BETWEEN @startdate AND @enddate
)
有什么想法吗?
答案 0 :(得分:0)
如果没有看到你得到的错误,很难分辨。但从查看您的查询可能是
WHERE id IN
含糊不清。尝试使用tasks.id
代替id
(或users.id
,如果您的意思是id)