如何在sqlserver里面实现筛选的功能?急,谢谢。100分附送。 select * from 一个表 aa where col2=(select min(col2) from 一个表 where col1=aa.col1) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 或:select * from 一个表 aa where col2=(select top 1 col2 from 一个表 where col1=aa.col1) select col1, min(col2) from table1 group by col1 select col1,(select top 1 col2 from table a where table.col1=a.col1) col2 from table 或select col1,(select min(col2) from table a where table.col1=a.col1) col2 from table 谢谢诸位。根据我自己的需要作了一下改良,select * from table1where id in (select col1,min(id) from table1)为了保证唯一性,id为标识列,不一定是col2 奇怪的问题 |zyciis| 如何对表记录进行更新锁和排他锁,不是用select 和 update 谢谢 如何查看所建立的表约束如:主键约束,Check约束等等 时间比较,在线等待!!~~~~ SQL Server 2000 写入数据慢 如表,这种SQL语句怎么写 怎么能将foxpro2.5中的数据导入到sqlserver2000中 insert语句小问题 我用MSHFlexGrid显示数据库数据,如何让MSHFlexGrid滚动时最左边的一列数据不动? 求救SQL 求恢复数据库语句,通过mdf和ldf文件来恢复数据库~~~急 t-sql语句怎么写?
select * from 一个表 aa where col2=(select top 1 col2 from 一个表 where col1=aa.col1)
或
select col1,(select min(col2) from table a where table.col1=a.col1) col2 from table
根据我自己的需要作了一下改良,
select * from table1
where id in
(select col1,min(id) from table1)为了保证唯一性,id为标识列,不一定是col2