我现在为了分页,得到两个语句,可是语句不同得到的数据确是相同的语句如下:首页:SELECT top 6 * from SYS_PRODUCT where productsubtypeId=53 or productsubtypeId=54 or productsubtypeId=0 and productId not in(select top 0 productId from SYS_PRODUCT where productsubtypeId=53 or productsubtypeId=54 or productsubtypeId=0 order by productId)order by productId第二页:
SELECT top 6 * from SYS_PRODUCT where productsubtypeId=53 or productsubtypeId=54 or productsubtypeId=0 and productId not in(select top 6 productId from SYS_PRODUCT where productsubtypeId=53 or productsubtypeId=54 or productsubtypeId=0 order by productId)order by productId数据库用的SqlServer,productsubtypeId和productId都是表内两个字段。我就是很纳闷为什么取出来的数据时一样的,请大家解惑,谢谢了!
SELECT top 6 * from SYS_PRODUCT where productsubtypeId=53 or productsubtypeId=54 or productsubtypeId=0 and productId not in(select top 6 productId from SYS_PRODUCT where productsubtypeId=53 or productsubtypeId=54 or productsubtypeId=0 order by productId)order by productId数据库用的SqlServer,productsubtypeId和productId都是表内两个字段。我就是很纳闷为什么取出来的数据时一样的,请大家解惑,谢谢了!
解决方案 »
- The type Map is not generic; it cannot be parameterized with arguments
- jsp filter 与 Struts2问题
- struts里,reset方法怎么用
- 一个奇异问题求教
- LINUX+JBOSS环境下,验证码图片不能出来,需要在什么地方配置一下呢?!在线等!谢谢
- 新年怪问题(关于数据库与JSP.ASP.ASP.NET)
- 在webstart中加载图片的问题
- 请问在struts模式的系统中,权限如何控制?
- rest接收中文的json数据时报异常,springmvc大神请进~
- 项目windows下运行正常,但部署到linux上已启动tomcat就报错,求大神帮助解决
- JSP乱码问题
- 刷票器的实现
productsubtypeId=53 or productsubtypeId=54 or productsubtypeId=0 已经满足了条件如果你想用and 语句 应该跟没一个or语句单独使用
你可以在这三个条件外部加一个()括号,这样就会走下面的and条件了