select class.c_name,stu.s_no,stu.s_name from class,stu where class.c_id=stu.s_cid and class.c_stu>20 and stu.s_no like '_006%' order by stu.s_no desc
首先,不知道你的那两个表里的字段是否相同,所以我把表名都加上了,若是字段不相同,你可把表名去掉 select c_name,s_no,s_name from class,stu where c_id=s_cid and c_stu>20 and s_no like '_006%' order by s_no desc 再者,不知道你的字段s_no是几位,所以要用like '_006%'