select * from 表 a
where not exists(select * from 表 where material_class=a.material_class and [money]<a.[money])
where not exists(select * from 表 where material_class=a.material_class and [money]<a.[money])
解决方案 »
- mssql2000链接服务器出错???
- 关于表的创建脚本及数据插入脚本的问题
- 按时间段获得记录统计
- select 某个特定字段之外的所有字段值
- 这个触发器的问题怎么解决啊?各位大大们帮帮忙
- 请大家帮我看看这个提示应该怎么解决啊?
- 异类查询要求为连接设置 ANSI_NULLS 和 ANSI_WARNINGS 选项。这将确保一致的查询语义。请启用这些选项,然后重新发出查询。 怎么解决啊
- 请问一个sql排序名称的问题
- 如何使用account intelligence 在2005?
- HELP~~SQL Server存储进程一个小问题
- 视图可以建索引吗?
- 如何查找数据库中有identity属性的字段及对应表,并如何删除该属性
where money = (select min(money) from 表 where material_class=a.material_class and material_code=a.material_code )
group by material_class,material_code,material_name,indate
select material_class,material_code,material_name,min(money)
from 表
group by material_class,material_code,aterial_name
where money = (select min(money) from 表 where material_class=a.material_class and material_code=a.material_code )
where money = (select min(money) from 表 where material_class=a.material_class and material_code=a.material_code )