+ -
当前位置:首页 → 问答吧 → 请高人指教

请高人指教

时间:2011-12-08

来源:互联网

数据表
123 a b c
123 a b d
123 a b c
456 e f h
456 e f h
查询结果
123 a b c
123 a b d

作者: playboy7741   发布时间: 2011-12-08

a b c d e f h都是未知字符串

作者: playboy7741   发布时间: 2011-12-08

高手能否一句select 查询得出结果?

作者: playboy7741   发布时间: 2011-12-08

SQL code

declare @T table (col1 int,col2 varchar(1),col3 varchar(1),col4 varchar(1))
insert into @T
select 123,'a','b','c' union all
select 123,'a','b','d' union all
select 123,'a','b','c' union all
select 456,'e','f','h' union all
select 456,'e','f','h'

select TOP 2 * from @T
/*
col1        col2 col3 col4
----------- ---- ---- ----
123         a    b    c
123         a    b    d
*/

作者: maco_wang   发布时间: 2011-12-08

SQL code
select TOP 2 * from 你的表名

作者: maco_wang   发布时间: 2011-12-08

select TOP 2 * from tb

作者: szstephenzhou   发布时间: 2011-12-08

select top 2 * from tb

作者: fredrickhu   发布时间: 2011-12-08

热门下载

更多