SQL语法错误

blueiv 2007-12-06 02:43:01
select top 5 * from table1 where fid<(
select min(uid) from
(select top 10 fid from table1 order by uid desc)
)tem order by uid desc

用上面的查询说")附近有语法错误",
即使换成这样的语句也还是语法错误
select min(uid) from 
(select top 10 fid from table1 order by uid desc)
提示和上面的是一样的 ")附近有语法错误"
...全文
41 5 打赏 收藏 举报
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
blueiv 2007-12-06
谢谢
  • 打赏
  • 举报
回复
wzy_love_sly 2007-12-06
select top 5 * from table1 where fid<
(select min(fid) from (select top 10 fid from table1 order by uid desc) t
) order by uid desc

多tem 因为不表,是一个值
  • 打赏
  • 举报
回复
dawugui 2007-12-06
后面加个表别名如 T

select min(uid) from 
(select top 10 fid from table1 order by uid desc) t
  • 打赏
  • 举报
回复
-狙击手- 2007-12-06
select top 5 * from table1 where fid<(
select min(uid) from
(select top 10 fid from table1 order by uid desc) aaa
)tem order by uid desc
  • 打赏
  • 举报
回复
-狙击手- 2007-12-06
select min(uid) from 
(select top 10 fid from table1 order by uid desc) aa


加个别名
  • 打赏
  • 举报
回复
发帖
MS-SQL Server

3.3w+

社区成员

MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
帖子事件
创建了帖子
2007-12-06 02:43
社区公告
暂无公告