不知道你什么数据库啊如果是 sql server 的话SELECT TOP 1 * FROM zuowei WHERE stuid is NULL ORDER BY id;
select min(id) from zuowei where stuid is null
select * from 表 where stuid in not null order by id