楼主的意思是显示一条,插入一条,每次只能显示一条 stu_info 得有一个唯 一的ID,得有一个状态 STATUS 0 没显示过 1 已显示过select id,name,age from stu_info where status=0 order by id limit 1 insert into age-name select id,name,age from stu_info where status=0 order yb id limit 1; update stu_info set status=1 where id in (select id from age-name);
所以你只能所需要的结果先保存在一张表内。然后其它程序去访问这个表。
楼主一条sql搞定不就行了么?
stu_info 得有一个唯 一的ID,得有一个状态 STATUS 0 没显示过 1 已显示过select id,name,age from stu_info where status=0 order by id limit 1
insert into age-name select id,name,age from stu_info where status=0 order yb id limit 1;
update stu_info set status=1 where id in (select id from age-name);