| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 970 人关注过本帖
标题:子查询出错!
只看楼主 加入收藏
kevintang
Rank: 4
等 级:业余侠客
威 望:9
帖 子:799
专家分:236
注 册:2008-2-14
结帖率:80%
收藏
 问题点数:0 回复次数:1 
子查询出错!
SELECT top 4 dbo.SJUser.SJUser_Logo, dbo.SQ_News_Doings.SQ_News_Doings_Intro, dbo.SQ_News_Doings.SQ_News_Doings_Title, dbo.SQ_News_Doings.SQ_News_Doings_UpdateTime,dbo.SJUser.SJUser_SJName_CN, dbo.SJUser.SJUser_SJName_EN,dbo.SQ_News_Doings.SQ_News_Doings_BeginTime, dbo.SQ_News_Doings.SQ_News_Doings_EndTime, dbo.SQ_News_Doings.SQ_News_Doings_CreateTime,dbo.SQ_News_Doings.SQUser_ID,dbo.SQ_News_Doings.SQ_News_Doings_ID FROM dbo.SJUser INNER JOIN dbo.SQ_News_Doings ON dbo.SJUser.SJUser_ID = dbo.SQ_News_Doings.SJUser_ID  where  dbo.SQ_News_Doings.SQ_News_Doings_ID not in ( select top 4 dbo.SQ_News_Doings.SQ_News_Doings_ID FROM dbo.SJUser INNER JOIN dbo.SQ_News_Doings ON dbo.SJUser.SJUser_ID = dbo.SQ_News_Doings.SJUser_ID  where dbo.SQ_News_Doings.SQUser_ID = '15FF7571-F0DE-492C-ADD7-B46EC771E017' and '2008-3-19' >= SQ_News_Doings_BeginTime and '2008-3-19'<= SQ_News_Doings_EndTime)  order by SQ_News_Doings_UpdateTime desc


SELECT top 4 dbo.SJUser.SJUser_Logo, dbo.SQ_News_Doings.SQ_News_Doings_Intro, dbo.SQ_News_Doings.SQ_News_Doings_Title, dbo.SQ_News_Doings.SQ_News_Doings_UpdateTime,dbo.SJUser.SJUser_SJName_CN, dbo.SJUser.SJUser_SJName_EN,dbo.SQ_News_Doings.SQ_News_Doings_BeginTime, dbo.SQ_News_Doings.SQ_News_Doings_EndTime, dbo.SQ_News_Doings.SQ_News_Doings_CreateTime,dbo.SQ_News_Doings.SQUser_ID,dbo.SQ_News_Doings.SQ_News_Doings_Top FROM dbo.SJUser INNER JOIN dbo.SQ_News_Doings ON dbo.SJUser.SJUser_ID = dbo.SQ_News_Doings.SJUser_ID  where dbo.SQ_News_Doings.SQUser_ID = '15FF7571-F0DE-492C-ADD7-B46EC771E017' and '2008-3-19' >= SQ_News_Doings_BeginTime and '2008-3-19'<= SQ_News_Doings_EndTime order by SQ_News_Doings_UpdateTime desc


这两句查询语句!是子查询 我要按日期排序!怎么查处的的后4 条还有那个日期为最新的那条数据啊!
   是不是我的ORDER BY 放错地方了啊?
  请高手帮忙
搜索更多相关主题的帖子: Doings News dbo SJUser SJName 
2008-03-19 21:45
kevintang
Rank: 4
等 级:业余侠客
威 望:9
帖 子:799
专家分:236
注 册:2008-2-14
收藏
得分:0 
日! 自己改好了!
2008-03-21 09:22
快速回复:子查询出错!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038701 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved