create temp table A(stuid int,date1) select stuid,min(date) as date1 from tableA A group by stuid order by date1 dete1 limit 10 select * from tableB where stuid in (select stuid from A)
忘了说了 尽量少用点Mysql里的东西 标准的sql语句的好 我是在sqlServer里查询的 反正 看着你这个 应该差不多 在SqlServer那边 全是用不了的要么看不懂是什么东西 一大堆代码粘贴过来了 ..... 谢谢你啦 在帮帮我想想看 order by group by都没问题 select stuid,min(date) as date1有问题
create temp table A(stuid int,date1)
select stuid,min(date) as date1
from tableA A
group by stuid
order by date1 dete1
limit 10
select * from tableB where stuid in (select stuid from A)
反正 看着你这个 应该差不多 在SqlServer那边 全是用不了的要么看不懂是什么东西 一大堆代码粘贴过来了
.....
谢谢你啦 在帮帮我想想看
order by group by都没问题 select stuid,min(date) as date1有问题