问题
How can I get 3rd shift data from the where clause. I'm using current date, but even with what I don't get any resutls. I'm looking to see 3rd shift sale from time range 9pm to 5am ( Next Day ).
SELECT WORK_CENTER, SUM(SALES) AS SALES
FROM ZME_SALES
WHERE DATE_TIME_START >=sys_extract_utc(cast(trunc(current_date) + 21/24 as time stamp with time zone))
AND DATE_TIME_START < sys_extract_utc(cast(trunc(current_date)+1 + 5/24 as timestamp with time zone))
Here's my expected results.
SHIFT WORK_CENTER SALES
SHIFT-3 8001 1524
SHIFT-3 8002 1347
SHIFT-3 8003 1201
SHIFT-3 8004 1146
来源:https://stackoverflow.com/questions/53603707/query-date-and-specific-time-in-the-where-clause-3