Как говорится в названии, я хочу найти способ проверить, какие из моих наборов данных находятся за 6 месяцев после SYSDATE через запрос.Oracle SQL - DATE больше, чем оператор
SELECT * FROM OrderArchive
WHERE OrderDate <= '31 Dec 2014';
Я пробовал следующее, но он возвращает ошибку, говоря, что мой формат даты неверен. Однако, вставив данные, я использовал этот формат даты в соответствии с запрошенным/предполагаемым и не имел проблем.
Error at Command Line : 10 Column : 25
Blockquote
Error report -
SQL Error: 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.
ли ваша дата хранится в виде 'date' или' VARCHAR'? –
«DATE» хранится как таковое, и я не могу их преобразовать, используя to_date – user3521826