博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年7月27日

摘要: 一、错误写法,错误信息:“在关键字 'distinct' 附近有语法错误。”。select top 10 distinct EmpName, Sex, Age, DeptName from tbEmployee order by EmpName二、正确写法,解析:distinct要放到top前面,先将数据distinct去重复,然后再取其中的前10行。select distinct top 10 EmpName, Sex, Age, DeptName from tbEmployee order by EmpName 阅读全文

posted @ 2011-07-27 09:51 风之韵 阅读(1324) 评论(0) 推荐(0)