select img from(select top 1 img,time from table order by time desc)a
union all
select null
union all
select null
union all
select null
union all
select null
union all
select null
union all
select null
union all
select null
union all
select null
我看不是很懂!用这样的选择语句就可以
选择出结果集5个时间最新的标题和1个时间最新的图片吗???这样的结果集可以绑定到asp.net中的datagrid 中吗?
是这样吗?
select a from table
union all
select b from table
.
.
.
视图不能用union all的!
select a.title, b.img from
(select top 5 pk,title from table order by time decs) a left join
(select top 1 pk,img from table order by time decs) b
on a.pk=b.pk
这个查询满足楼主的需求吗?
union all
select null
union all
select null
union all
select null
union all
select null