To select the most recent record based on the "actime" column, you can use the following SQL 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 will retrieve the "adjust_date" as "actime" and "adjust_person" as "person" columns from the "uf_adjust_history" table for the specified "adjust_person" values. The records will be sorted in descending order based on the "actime" column and only the first record will be returned, which will be the most recent one

select adjust_date as actime adjust_person as person from uf_adjust_history where adjust_person in + userid1 + 根据 actime 时间取最新的一条

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

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