本文介绍了内部sql语句中的条件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
以下语句假设显示的广告与Cookie位置相同并且正在运行,但条件批准其无法正常运行,因为所有用户的值均为批准列Y或N他们的广告出现在哪里只有Y值的用户出现我试图从
Hi
The below statement suppose to show the ads which is equal cookie Location and that is working but the condition approv its not working as all user whose have value into approv column Y or N their ads is appear where should only users whith Y value appears i tried also to change from
WHERE IUS.[approv]='Y'
改为
And IUS.[approv]='Y'
但问题仍然存在
but the problem still exist
string HPAdsFQuery = @"SELECT AD.[AdsID], AD.[Country], AD.[State], AD.[City], AD.[AdsTit], SUBSTRING([AD.AdsDesc],1,50) as AD.AdsDesc,
AD.[AdsPrice], AD.[Section], AD.[Category], AD.[Img1], AD.[AdsDate], IUS.[approv] FROM [ads] as AD JOIN UserInfo as IUS ON AD.[Country] = @Location WHERE IUS.[approv]='Y' ORDER BY AD.[AdsDate] DESC";
推荐答案
这篇关于内部sql语句中的条件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!