1 2SELECT max(sid) FROM `tbl_test` where sid < (SELECT max(sid) FROM `tbl_test`); SELECT max(sid) FROM `tbl_test` where sid != (SELECT max(sid) FROM `tbl_test`);
1 2SELECT min(sid) FROM (SELECT sid FROM `tbl_test` order BY sid DESC limit 2) as tmp; SELECT min(sid) FROM (SELECT sid FROM `tbl_test` group BY sid DESC limit 2) as tmp;
Copyright ©2010-2022 比特日记 All Rights Reserved.