select
a.*
from
表 a
where
a.title in(select top 5 title from 表 order by price desc)
order by
a.category,a.price
a.*
from
表 a
where
a.title in(select top 5 title from 表 order by price desc)
order by
a.category,a.price
解决方案 »
- 怎么把索引视图放到一个单独的硬盘里?
- 两张表之间建立关系的时候出错,恳请帮忙解决,还有50分哦!
- sql2000 中数字类型字段怎样保留2位小数不足补零??
- 求一SQL语句,高手们帮帮忙!!
- 求一条简单的SQL语句!
- SQL 6.5 的index建构.高分求救!!!
- 关于sql server的安装
- sky_blue(老衲)兄的100分, 谢谢!(详情见一个初中级难度问题请高手帮忙! 分好说, 帮我解决的至少500。帖子)
- 帮我解决select或新建视图的一个问题
- 急急急,sql 数据库中有空行,怎么删除?(没有数据但占了行数)
- 请教高手:sybase数据库有数据插入时同时插入到SQL Server数据库中的方法?
- 问一个Sql的查询语句,有点难度
where (select count(1) from 表 where category=t.category and price>=t.price)<=5
前一个 SQL 遗漏了一个关键的条件,修正一下:
------------------------------------------
select
a.*
from
表 a
where
a.title in(select
top 5 title
from
表
where
category=a.category
order by
price desc)
order by
a.category,a.price