BETWEEN and
select * from (
select *,ROW_NUMBER() over (ORDER BY AddTime desc) RowNumber from Product
where ID not in (
select top 10 a.ID
from Product a left join ProductType b on a.ProductType=b.ID
where a.DeleteState=0 order by a.AddTime desc
) and DeleteState=0
) t
where t.RowNumber BETWEEN 0 and 2
随机推荐
- MySQL- 锁(3)
InnoDB在不同隔离级别下的一致性读及锁的差异 前面讲过,锁和多版本数据是InnoDB实现一致性读和ISO/ANSI SQL92隔离级别的手段,因此,在不同的隔离级别下,InnoDB处理SQL时采用 ...
- android获取设备全部信息
private static final String FILE_MEMORY = "/proc/meminfo"; private static final String FIL ...
- Spring整合CXF之发布WebService服务
今天我们来讲下如何用Spring来整合CXF,来发布WebService服务: 给下官方文档地址:http://cxf.apache.org/docs/writing-a-service-with-s ...
- Shiro源码分析-初始化-Realm
在上一篇介绍SecurityManager的初始化过程中,也有realm的粗略介绍. realm的概念在安全领域随处可见: 各种中间件的realm.spring security的realm.shir ...
- hadoop MapReduce 工作机制
摸索了将近一个月的hadoop , 在centos上配了一个伪分布式的环境,又折腾了一把hadoop eclipse plugin,最后终于实现了在windows上编写MapReduce程序,在cen ...
- Dynamics AX Read OLEDB
static System.Data.DataTable getOLEDB_Record(str _dbPath,str _query) { System.Data.OleDb.OleDbConnec ...
- [LeetCode]题解(python):063-Unique path II
题目来源 https://leetcode.com/problems/unique-paths-ii/ Follow up for "Unique Paths": Now cons ...
- SQL Server select 将类型相同的行合并,并将对应金额相加
select Category,REPLACE(sum(Amount),'-','') as Amountfrom T_Detail WHERE CREATED_BY='6123EC14-50E2- ...
- ant 执行到javac时运行中止,怎么办?
今天下午我用ant,明明都能打出target.后来改了点代码就不行了,执行到compile的javac时运行中止,真是见鬼了. 在ant构建文件上右击,点击"run as"-> ...
- LeetCode Longest Palindrome
原题链接在这里:https://leetcode.com/problems/longest-palindrome/ 题目: Given a string which consists of lower ...