To retrieve the latest record based on the 'actime' column, you can use the following query:

SELECT adjust_date AS actime, adjust_person AS person
FROM uf_adjust_history
WHERE adjust_person IN (" + userid1 + ")
ORDER BY actime DESC
LIMIT 1;

This query selects the 'adjust_date' as 'actime' and 'adjust_person' as 'person' from the 'uf_adjust_history' table. It filters the records based on the 'adjust_person' column using the provided 'userid1' value. The records are then ordered in descending order by 'actime' and limited to only retrieve the first record using 'LIMIT 1'.

Oracle SQL: Retrieve Latest Record Based on Timestamp (actime)

原文地址: https://www.cveoy.top/t/topic/pZur 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录