I have trouble in the SQL query to display the data fields whose records are above 29-12-2018 on Oracle ,
SELECT * FROM
data
WHERE date BETWEEN('29-12-2018' AND '01-01-2019')
ORDER BY datetime DESC
I have trouble in the SQL query to display the data fields whose records are above 29-12-2018 on Oracle ,
SELECT * FROM
data
WHERE date BETWEEN('29-12-2018' AND '01-01-2019')
ORDER BY datetime DESC
On
You can either use
SELECT *
FROM data
WHERE "date" > to_date('2018-12-29','yyyy-mm-dd') --> needs formatting as the second argument
ORDER BY datetime DESC
or
SELECT *
FROM data
WHERE "date" > date'2018-12-29' --> literal according to "ISO 8601" standard
ORDER BY datetime DESC
where date is converted to "date" since, it's a reserved keyword, and not possible to create a table with this column name.
You need to use
to_date()function to convert your string to a date.