情况是这样,一个类似商城的网站,有很多店铺,店铺里有很多商品,用户可以将他们一些最新最有特色的商品推荐出来。
现在想这么查询:查询出10条最新的推荐商品,但是每个店铺只查询出2个。
现在想这么查询:查询出10条最新的推荐商品,但是每个店铺只查询出2个。
解决方案 »
- 求助 FCKeditor在线编辑器上传无反应
- 使用ModalPopupExtender控件弹出来的Panel如何让里面的一个文本框自动获取输入焦点
- 如何在网页中实现天气预报的消息啊
- 编译器错误消息: CS0433: 类型“ASP.leftlist_ascx"
- Error Initializing Session 上传大数据
- 设计一个信息发布系统,大概200个用户,每个用户在自己的子页面上,可以自定义栏目,怎么设计数据库?
- ★★急救新手!关于ASP.NET的调试问题
- 在ASP.NET中,怎么使用户在没有键盘鼠标操作后,间隔一定时间,自动退出系统?
- .net正式版的例子在哪个目录下
- Session在网页之间的数据传递
- 怎么实现每单击botton事件,就动态添加TextBox,并获取所输入textbox的值
- asp.net如何入门
select top10 * from
(
select top 2 from 店铺1 where 特色='asd' order by id desc
union all
select top 2 from 店铺2 where 特色='asd' order by id desc
union all
select top 2 from 店铺3 where 特色='asd' order by id desc
union all
select top 2 from 店铺4 where 特色='asd' order by id desc
union all
select top 2 from 店铺5 where 特色='asd' order by id desc
)t
使用临时表吧
select top 2 * into #tb from 商品 where 店铺="aa" order by 特色
insert into #tb select top 2 * from 商品 where 店铺="bb" order by 特色
insert into #tb select top 2 * from 商品 where 店铺="cc" order by 特色
select * from #tb
drop table #tb
select distinct(spid)from sp