注册 登录
编程论坛 SQL Server论坛

这样SQL语句如何在连接一个表读取其中字段的值。

ysf0181 发布于 2010-07-27 08:58, 672 次点击
select bianhao,xueyuan,id from jiaoyuanclass where id in (select max(id) from jiaoyuanclass group by xueyuan) order by id desc

在读取  表:person  字段:zcishu 中的值,,,,是以  xueyuan 的值来传到给 相等 表person中字段zcishu中

2 回复
#2
ysf01812010-07-27 08:59
select * from table1,table2 where table2.id in (
select max(id) from table2 group by name) and table1.name
=table2.name;

select * from person,jiaoyuanclass where jiaoyuanclass.id in(select max(id) from jiaoyuanclass group by xueyuan) and person.name=jiaoyuanclass.xueyuan
#3
dearwolf41282010-07-28 10:41
楼主自己已经解决了,那就结贴吧!都好几天了!
1