SELECT
scheduling_appointment.scheduling_datetime
FROM
scheduling_appointment
I need to include a WHERE statement to pull only dates within the last week, but the date and time are in the same column:
2020-12-01 09:30:00-06
2022-09-12 08:00:00-06
2021-02-22 10:30:00-06
How can I do this? I don't think a LIKE statement would work.
date_truncfunction andintervalexpression, see this SO answer for ideasTIMESTAMP, and not a text-type column such asVARCHAR. A timestamp is easy to compare to values in the last week using<and>.