一张数据表中有 word1,word2,wordid,wordnum,请问下面的语句为何会出错?select * from V3DWORD
where WordNum > 100
group by word1
having COUNT(word1) > 10错误:消息 8120,级别 16,状态 1,第 1 行
选择列表中的列 'V3DWORD.Word2' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中。
where WordNum > 100
group by word1
having COUNT(word1) > 10错误:消息 8120,级别 16,状态 1,第 1 行
选择列表中的列 'V3DWORD.Word2' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中。
from V3DWORD
where WordNum > 100
group by word1
having COUNT(word1) > 10
group by word1,word2.......
按照word1分组为什么还会count(word1)>10这根本不可能数据啊
或select word1 from V3DWORD
where WordNum > 100
group by word1
having COUNT(word1) > 10
from V3DWORD
where WordNum > 100
group by word1
having COUNT(word1) > 10
declare @tab table(id int)
insert into @tab
select 1 union all
select 1 union all
select 1 union all
select 2
select id,count(id) from @tab
group by id
having count(id)>2