ALTER PROCEDURE dbo.get_all_digg_articles select AllRssArticles.*, (select this_title from RssChannels where this_id=AllRssArticles.this_channel_id) as this_channel_title
from AllDiggArticles, AllRssArticles where AllDiggArticles.this_article_id=AllRssArticles.this_id问题是这样,在表AllRssArticles中有一个字段是ntext类型的,在所有表AllDiggArticles中会有重复的this_article_id的值,原则上是 应该用distinct AllRssArticles.id,可是由于表中含有ntext类型的字段,distinct不能用。求用什么办法能实现我的目的。
from AllDiggArticles, AllRssArticles where AllDiggArticles.this_article_id=AllRssArticles.this_id问题是这样,在表AllRssArticles中有一个字段是ntext类型的,在所有表AllDiggArticles中会有重复的this_article_id的值,原则上是 应该用distinct AllRssArticles.id,可是由于表中含有ntext类型的字段,distinct不能用。求用什么办法能实现我的目的。
解决方案 »
- 这种SQL语句要怎么写
- 一个数据库的列变行问题
- sql 2000 serve 安装问题(与操作系统有关)!
- SQL中的case查询
- SQL Server中怎样查询一个对象被哪些对象在使用
- 高手看一下,asp.net 和sqlserver2000连接 为什么多用户后就慢呢?
- 关于Job定时执行T-SQL,还是数据量的问题。
- 求救,急急!!!!!
- 存储过程调用存储过程的问题
- 连接sqlserver 2014 用名称可以链接 IP 不行 求好心人帮忙~
- 本机测试300万条记录中模糊查询化了37秒,请问大家有没有好的查询方法,谢谢
- EXEC sp_dboption 'msdb', 'single user', 'true' 出错
from AllDiggArticles, AllRssArticles where AllDiggArticles.this_article_id=AllRssArticles.this_id
改为:
select a.* ,c.this_title
from AllRssArticles a
right join AllDiggArticles b on a.this_id = b.this_article_id
inner join RssChannels c on c.this_id = a.this_id