要根据insp_point_id找到对应的sort_num值小的上一条记录,可以使用以下SQL查询语句:

SELECT * FROM your_table_name
WHERE insp_point_id = 6 AND sort_num < 2
ORDER BY sort_num DESC
LIMIT 1;

在上述查询语句中,你需要将"your_table_name"替换为你的表名。此查询语句将返回insp_point_id为6且sort_num值小于2的记录中,sort_num值最大的一条记录。

mysql 表结构id	insp_plan_id	insp_point_id	sort_num27	14	9	128	14	6	2根据insp_point_id 找到 对应的sort_num值小的上一条记录

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

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