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
随机推荐
- mvc EF 数据保存时,报错:”对一个或多个实体的验证失败……“之解决
在EF5.0添加实体数据到数据库的时候,出现“对一个或多个实体的验证失败.有关详细信息,请参见“EntityValidationErrors”属性这个错误 解决: SaveChanges前先关闭验证实 ...
- eclipse有时候会报错:Cannot change version of project facet Dynamic Web Module to 2.5。这个错误不会影响程序的运行,不过看着总是不舒服。这个问题现在可以解决啦。
把项目WEB-INF底下的web.xml文件头部的: <?xml version="1.0" encoding="UTF-8"?> < ...
- QDir路径的测试与创建-QT
#include <QCoreApplication> #include <QDir> #include<QtDebug > #include<QFileIn ...
- new和delete malloc和free
程序中动态分配的对象存放在自由存储区(free store)或堆(heap). C语言程序使用一对标准库函数malloc和free在自由存储区中分配存储空间,而C++语言则使用new和delete表达 ...
- magento安装新插件后后台配置空白解决办法
前段时间,安装完Magento插件以后,就会出现空白或者404问题,在某些运营中的magento网站,安装新插件后后台配置空白解决. 1 将sysytem->toos->Compilati ...
- centos 6.4 安装视频解码器
cd /etc/yum.repos.d/ wget http://mirrors.163.com/.help/CentOS6-Base-163.repo yum update rpm -Uhv htt ...
- JavaScript实现dropdownlist选定值后将选定值的key与value填入两个textbox中
<script language="javascript" type="text/javascript"> var txtText0 = " ...
- LintCode Subtree
原题链接在这里:http://www.lintcode.com/en/problem/subtree/ You have two every large binary trees: T1, with ...
- opencv hog+svm行人检测
http://blog.csdn.net/masibuaa/article/details/16105073 http://blog.csdn.net/u011263315/article/detai ...
- docker启动Mysql(转)
cs202@cs202-devbox:~$ sudo docker run -d mysql7698fdd7a2d05d38cf19c60cc9e35c1117fc551ae5e31914494715 ...