那位虾哥教教:group by的规则是怎样的?
现在是越看越糊涂了 问题点数:20、回复次数:3Top
1 楼libin_ftsafe(子陌红尘:TS for Banking Card)回复于 2005-06-02 21:21:28 得分 0
看联机帮助里的语法说明。Top
2 楼yjdn(人形机器)回复于 2005-06-02 22:53:55 得分 10
给你写一个例子:
--建表
create table tb(id int,content int)
insert into tb select 1,2
union all select 1,10
union all select 2,20
union all select 2,40
--查询
select ID ,max(content) from tb group by idTop
3 楼zhangzs8896(小二)回复于 2005-06-03 09:16:14 得分 10
group by 字段
就是按字段进行分组啊,除了写在group by 内的字段外,如果还select别的字段,那么那些字段必须是聚合函数。Top




