日期:2014-05-18  浏览次数:20532 次

深夜求助,还有人在吗?
请问这句那里出错了.
select   Content,ChannelID,ClassID,Title,count(*)   from   PE_Article
group   by   Content,ChannelID,ClassID,Title
having   count(*)> =2   and   ChannelID= '1035 '

服务器:   消息   306,级别   16,状态   2,行   1
不能比较或排序   text、ntext   和   image   数据类型,除非使用   IS   NULL   或   LIKE   运算符。
服务器:   消息   306,级别   16,状态   1,行   1
不能比较或排序   text、ntext   和   image   数据类型,除非使用   IS   NULL   或   LIKE   运算符。
Content是ntext,我想把它显示出来.

------解决方案--------------------
try:
select Content=isnull(Content, ' '),ChannelID,ClassID,Title,count(*) from PE_Article
group by isnull(Content, ' '),ChannelID,ClassID,Title
having count(*)> =2 and ChannelID= '1035 '
------解决方案--------------------
select (select b.Content from PE_Article b where b.id=a.id) as Content,a.ChannelID,a.ClassID,a.Title,count(a.*) from PE_Article a
group by a.ChannelID,a.ClassID,a.Title
having count(a.*)> =2 and a.ChannelID= '1035 '