On 9/25/21 7:39 AM, John English wrote:
SELECT id,DateTimeFormat(time,null) AS t_time,name,username,facility,event,details
FROM system_log
ORDER BY id DESC
NULLS LAST
FETCH FIRST 20 ROWS ONLY;

I can remember whether you tried to rewrite the query to use a subquery. Something like this:

SELECT id, time AS t_time,name,username,facility,event,details
FROM
  system_log s,
  (
    SELECT id AS log_id
    FROM system_log
    ORDER BY id DESC
    NULLS LAST
    FETCH FIRST 20 ROWS ONLY
  ) t
WHERE s.id = t.log_id
;

Does that help?

-Rick

Reply via email to