查询表中第一条或最后一条
SELECT * FROM user LIMIT 1; SELECT * FROM user ORDER BY id ASC LIMIT 1; SELECT * FROM user ORDER BY id DESC LIMIT 1;
以查询结果作为条件进行查询
SELECT id FROM auth_company WHERE user_id = (SELECT id FROM user WHERE username='ut251') ORDER BY id DESC LIMIT 1;