我正在翻译MySQL
查询Oracle/SQL
,因为我没有足够的经验来Oracle/SQL
处理这种错误,这对我来说是不干净的。
ORA-01861: literal does not match format string
01861. 00000 - "literal does not match format string"
*Cause: Literals in the input must be the same length as literals in
the format string (with the exception of leading whitespace). If the
"FX" modifier has been toggled on, the literal must match exactly,
with no extra whitespace.
*Action: Correct the format string to match the literal.
我的工作就在这里
SELECT * FROM
(SELECT p.ProjectID, p.CustomName, p.Name
FROM projects p
INNER JOIN
users u
ON
u.UserID = 193
WHERE
u.User_roleID = 1
UNION
SELECT p.ProjectID, p.CustomName, p.Name
FROM projects p
WHERE
(p.Responsible_person_id = 193 OR p.Delivery_contact = 193)
AND
(SYSDATE BETWEEN to_date(p.StartDate) AND to_date(p.EndDate))
AND
p.status = 2
UNION
SELECT rs.ProjectID, pr.CustomName, pr.Name
FROM
responsible_persons rs
LEFT JOIN
projects pr
ON
pr.ProjectID = rs.ProjectID
WHERE
rs.UserID = 193
AND
(SYSDATE BETWEEN to_date(pr.StartDate) AND to_date(pr.EndDate))
AND
pr.status = 2
UNION
SELECT p.ProjectID, p.CustomName, p.Name
FROM project_users_schedule_dates pusd
LEFT JOIN projects p
ON
p.ProjectID = pusd.ProjectID
WHERE pusd.UserID = 193
AND
(SYSDATE BETWEEN to_date(pusd.StartDate) AND to_date(pusd.EndDate+1))
AND p.status = 2) a
--GROUP BY a.ProjectID
ORDER BY a.CustomName, a.ProjectID
到目前为止,我检查line-by-line
并看不出这里有什么问题。
我在这里想念什么?错误来自哪里?