+ -
当前位置:首页 → 问答吧 → 求救,这个代码要怎么改

求救,这个代码要怎么改

时间:2011-08-02

来源:互联网

exec="select * from u_Company_Product where IsPass=1 and IsCommend=1 order by ID desc"

上面的代码IsCommend=1是判断显示推荐的列表,怎么改成判断显示非推荐的列表呢?

[ 本帖最后由 maxawei 于 2011-8-2 15:31 编辑 ]

作者: maxawei   发布时间: 2011-08-02

IsCommend<>1

作者: alphat   发布时间: 2011-08-02

IsCommend<>1  就不显示内容了

作者: maxawei   发布时间: 2011-08-02

select * from u_Company_Product where IsPass=1 order by ID desc
这个显示所有列表

exec="select * from u_Company_Product where IsPass=1 and IsCommend=1 order by ID desc"
这个显示推荐列表

怎么改成显示非推荐列表?

作者: maxawei   发布时间: 2011-08-02

select * from u_Company_Product where IsPass=1 and IsCommend<>1 order by ID desc

作者: WellFrog   发布时间: 2011-08-02

引用:
原帖由 WellFrog 于 2011-8-2 15:53 发表
select * from u_Company_Product where IsPass=1 and IsCommend1 order by ID desc
还是不显示内容了

作者: maxawei   发布时间: 2011-08-02

你先确认有没有非推荐内容

作者: WellFrog   发布时间: 2011-08-02

如果还有其他什么选项的就使用这个,select * from u_Company_Product where IsPass=1 and  id not in(select id from u_Company_Product where IsPass=1 and IsCommend=1) order by ID desc
没有其他的就使用select * from u_Company_Product where IsPass=1 and IsCommend<>1 order by ID desc

作者: xxs8418   发布时间: 2011-08-02

热门下载

更多